Package org.eclipse.cdt.core.settings.model

Examples of org.eclipse.cdt.core.settings.model.ICProjectDescription


     * @see addLibraryDependency {@link #addLibraryDependency(IProject, IProject)}
     */
    public static void addIncludeFolder(IProject project, IPath IncludePath) {
  // find all languages
  ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
  ICProjectDescription projectDescription = mngr.getProjectDescription(project, true);
  ICConfigurationDescription configurationDescription = projectDescription.getDefaultSettingConfiguration();
  addIncludeFolder(configurationDescription, IncludePath);

  projectDescription.setActiveConfiguration(configurationDescription);
  projectDescription.setCdtProjectCreated();
  try {
      mngr.setProjectDescription(project, projectDescription, true, null);
  } catch (CoreException e) {
      Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Could not add folder " + IncludePath.toOSString()
        + " to includepoth in project" + project.getName(), e));
View Full Code Here


  return true;
    }

    private void importLibs(String PathVarName, TreeItem[] AllItems) {
  ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
  ICProjectDescription projectDescription = mngr.getProjectDescription(myProject, true);
  ICConfigurationDescription configurationDescriptions[] = projectDescription.getConfigurations();

  for (TreeItem CurItem : AllItems) {
      if (CurItem.getChecked()) {
    try {
        ArduinoHelpers.addCodeFolder(myProject, PathVarName, CurItem.getText(), ArduinoConst.WORKSPACE_LIB_FOLDER + CurItem.getText(),
View Full Code Here

     */
    public static void setCProjectDescription(IProject project, ArrayList<ConfigurationDescriptor> alCfgs, boolean isManagedBuild,
      IProgressMonitor monitor) throws CoreException {

  ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
  ICProjectDescription des = mngr.createProjectDescription(project, false, false);
  ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
  ManagedProject mProj = new ManagedProject(des);
  info.setManagedProject(mProj);
  monitor.worked(20);

  // String s = "it.baeyens.arduino.core.toolChain.release";
  // IToolChain tcs = ManagedBuildManager.getExtensionToolChain(s);
  //
  // Configuration cfg = new Configuration(mProj, (ToolChain) tcs, ManagedBuildManager.calculateChildId(s, null), "Release");
  // IBuilder bld = cfg.getEditableBuilder();
  // if (bld != null) {
  // if (bld.isInternalBuilder()) {
  // IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
  // IBuilder prefBuilder = prefCfg.getBuilder();
  // cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
  // bld = cfg.getEditableBuilder();
  // bld.setBuildPath(null);
  // }
  // bld.setManagedBuildOn(isManagedBuild);
  // } else {
  // System.out.println("Messages.StdProjectTypeHandler_3");
  // }
  // cfg.setArtifactName(mProj.getDefaultArtifactName());
  // CConfigurationData data = cfg.getConfigurationData();
  // ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
  //
  // ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);

  // Iterate across the configurations
  for (int i = 0; i < alCfgs.size(); i++) {
      IToolChain tcs = ManagedBuildManager.getExtensionToolChain(alCfgs.get(i).ToolchainID);

      Configuration cfg = new Configuration(mProj, (ToolChain) tcs, ManagedBuildManager.calculateChildId(alCfgs.get(i).ToolchainID, null),
        alCfgs.get(i).Name);
      IBuilder bld = cfg.getEditableBuilder();
      if (bld != null) {
    // if (bld.isInternalBuilder()) {
    // IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
    // IBuilder prefBuilder = prefCfg.getBuilder();
    // String name = prefBuilder.getName();
    // cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), name);
    // bld = cfg.getEditableBuilder();
    // bld.setBuildPath(null);
    // }
    bld.setManagedBuildOn(isManagedBuild);
    cfg.setArtifactName("${ProjName}");
      } else {
    System.out.println("Messages.StdProjectTypeHandler_3");
      }
      CConfigurationData data = cfg.getConfigurationData();
      ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);

      setDefaultLanguageSettingsProviders(project, alCfgs.get(i), cfg, cfgDes);
  }
  monitor.worked(50);
  mngr.setProjectDescription(project, des);
View Full Code Here

    @Override
    protected String getCompilerCommand(String languageId) {
  String compilerCommand = "";
  // ArduinoProperties arduinoProperties = new
  // ArduinoProperties(currentProject);
  ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(currentProject);

  IEnvironmentVariableManager envManager = CCorePlugin.getDefault().getBuildEnvironmentManager();
  // IContributedEnvironment contribEnv =
  // envManager.getContributedEnvironment();
  ICConfigurationDescription confDesc = prjDesc.getActiveConfiguration();
  // Bug fix for CDT 8.1 fixed in 8.2
  IFolder buildFolder = currentProject.getFolder(confDesc.getName());
  if (!buildFolder.exists()) {
      try {
    buildFolder.create(true, true, null);
View Full Code Here

    public Change perform(IProgressMonitor pm) throws CoreException {

  ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
  IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
  for (int curProject = 0; curProject < projects.length; curProject++) {
      ICProjectDescription projectDescription = mngr.getProjectDescription(projects[curProject], true);
      if (projectDescription != null) { // if the description is null it probably is not a cdt project
    ICConfigurationDescription configurationDescriptions[] = projectDescription.getConfigurations();
    boolean projectDescriptionChanged = false;
    for (int curConfigDescription = 0; curConfigDescription < configurationDescriptions.length; curConfigDescription++) {

        ICFolderDescription folderDescription = configurationDescriptions[curConfigDescription].getRootFolderDescription();
        ICLanguageSetting[] languageSettings = folderDescription.getLanguageSettings();
View Full Code Here

    // }
    // return null;
    // }

    private static ICConfigurationDescription[] getCfgs(IProject prj) {
  ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(prj, false);
  if (prjd != null) {
      ICConfigurationDescription[] cfgs = prjd.getConfigurations();
      if (cfgs != null) {
    return cfgs;
      }
  }
View Full Code Here

     * @param defaultvalue
     *            The return value if the variable is not found.
     * @return
     */
    static public String getBuildEnvironmentVariable(IProject project, String configName, String EnvName, String defaultvalue) {
  ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
  return getBuildEnvironmentVariable(prjDesc.getConfigurationByName(configName), EnvName, defaultvalue);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.cdt.core.settings.model.ICProjectDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.