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

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


              }
              //if the path was added successfully
              if (success) {
                //save project build info
                ManagedBuildManager.saveBuildInfo(proj, true);   
                ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(proj);
                try {
                  CoreModel.getDefault().setProjectDescription(proj, projectDescription);
                } catch (CoreException e) {
                  e.printStackTrace();
                }
View Full Code Here


  {
    String projectName = commandLine.getValue(Options.PROJECT_OPTION);
    String lang = commandLine.getValue(Options.LANG_OPTION);

    IProject project = ProjectUtils.getProject(projectName);
    ICProjectDescription desc =
      CCorePlugin.getDefault().getProjectDescription(project, true);
    ICConfigurationDescription[] configs = desc.getConfigurations();
    ICLanguageSettingEntry entry = createEntry(commandLine);

    for(ICConfigurationDescription config : configs){
      ICFolderDescription fdesc = config.getRootFolderDescription();
      ICLanguageSetting[] ls = fdesc.getLanguageSettings();
View Full Code Here

  {
    String projectName = commandLine.getValue(Options.PROJECT_OPTION);
    String lang = commandLine.getValue(Options.LANG_OPTION);

    IProject project = ProjectUtils.getProject(projectName);
    ICProjectDescription desc =
      CCorePlugin.getDefault().getProjectDescription(project, true);
    ICConfigurationDescription[] configs = desc.getConfigurations();
    ICLanguageSettingEntry entry = createEntry(commandLine);

    boolean deleted = false;
    for(ICConfigurationDescription config : configs){
      ICFolderDescription fdesc = config.getRootFolderDescription();
View Full Code Here

    throws Exception
  {
    String projectName = commandLine.getValue(Options.PROJECT_OPTION);

    IProject project = ProjectUtils.getProject(projectName);
    ICProjectDescription desc =
      CCorePlugin.getDefault().getProjectDescription(project, false);
    ICConfigurationDescription[] cconfigs = desc.getConfigurations();

    ArrayList<HashMap<String,Object>> configs =
      new ArrayList<HashMap<String,Object>>();
    for(ICConfigurationDescription cconfig : cconfigs){
      HashMap<String,Object> cfg = new HashMap<String,Object>();
View Full Code Here

    String dir = commandLine.getValue(Options.DIR_OPTION);
    String excludes = commandLine.getValue(Options.EXCLUDES_OPTION);
    dir = FileUtils.removeTrailingSlash(dir);

    IProject project = ProjectUtils.getProject(projectName);
    ICProjectDescription desc =
      CCorePlugin.getDefault().getProjectDescription(project, true);
    ICConfigurationDescription[] configs = desc.getConfigurations();

    ArrayList<IPath> excludePaths = new ArrayList<IPath>();
    if(excludes != null){
      for(String exclude : StringUtils.split(excludes, ',')){
        excludePaths.add(new Path(exclude));
View Full Code Here

    String projectName = commandLine.getValue(Options.PROJECT_OPTION);
    String dir = commandLine.getValue(Options.DIR_OPTION);
    dir = FileUtils.removeTrailingSlash(dir);

    IProject project = ProjectUtils.getProject(projectName);
    ICProjectDescription desc =
      CCorePlugin.getDefault().getProjectDescription(project, true);
    ICConfigurationDescription[] configs = desc.getConfigurations();
    boolean deleted = false;
    for(ICConfigurationDescription config : configs){
      ICSourceEntry[] sources = config.getSourceEntries();
      ArrayList<ICSourceEntry> keep = new ArrayList<ICSourceEntry>();
      for(ICSourceEntry entry : sources){
View Full Code Here

    // FIXME: force load of file from disk
    ICProjectDescriptionManager manager =
      CoreModel.getDefault().getProjectDescriptionManager();
    //manager.updateProjectDescriptions(new IProject[]{project}, null);

    ICProjectDescription desc = manager.getProjectDescription(project, false);

    ICConfigurationDescription config = desc.getDefaultSettingConfiguration();
    PathEntryTranslator.PathEntryCollector cr =
      PathEntryTranslator.collectEntries(project, config);

    IPathEntry[] entries = cr.getEntries(
        PathEntryTranslator.INCLUDE_USER, config);
View Full Code Here

        IProgressMonitor monitor)
      throws CoreException
    {
        ICProjectDescriptionManager mngr =
          CoreModel.getDefault().getProjectDescriptionManager();
        ICProjectDescription des =
          mngr.createProjectDescription(project, false, !onFinish);
        ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
        ManagedProject mProj = new ManagedProject(des);
        info.setManagedProject(mProj);
        monitor.worked(20);
        cfgs = CfgHolder.unique(getCfgItems(false));
        cfgs = CfgHolder.reorder(cfgs);
        int work = 50 / cfgs.length;
        for (int i = 0; i < cfgs.length; i++) {
          String s = (cfgs[i].getToolChain() == null) ?
            "0" : ((ToolChain)(cfgs[i].getToolChain())).getId()//$NON-NLS-1$
          Configuration cfg = new Configuration(
              mProj,
              (ToolChain)cfgs[i].getToolChain(),
              ManagedBuildManager.calculateChildId(s, null),
              cfgs[i].getName());
          cfgs[i].setConfiguration(cfg);
          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(false);
          }
          cfg.setArtifactName(mProj.getDefaultArtifactName());
          CConfigurationData data = cfg.getConfigurationData();
          des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
          monitor.worked(work);
        }
        mngr.setProjectDescription(project, des);
    }
View Full Code Here

      // Add the Arduino folder
      ArduinoHelpers.createNewFolder(project, "arduino", null);

      // Set the environment variables
      ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);

      for (int i = 0; i < cfgNamesAndTCIds.size(); i++) {
    ICConfigurationDescription configurationDescription = prjDesc.getConfigurationByName(cfgNamesAndTCIds.get(i).Name);
    mArduinoPage.saveAllSelections(configurationDescription);
    ArduinoHelpers.setTheEnvironmentVariables(project, configurationDescription, cfgNamesAndTCIds.get(i).DebugCompilerSettings);
      }

      // Set the path variables
      ArduinoHelpers.setProjectPathVariables(project, mArduinoPage.getPlatformFolder());

      // Intermediately save or the adding code will fail
      // Release is the active config (as that is the "IDE" Arduino type....)
      ICConfigurationDescription defaultConfigDescription = prjDesc.getConfigurationByName(cfgNamesAndTCIds.get(0).Name);
      prjDesc.setActiveConfiguration(defaultConfigDescription);

      // Insert The Arduino Code
      // NOTE: Not duplicated for debug (the release reference is just to get at some environment variables)
      ArduinoHelpers.addArduinoCodeToProject(project, defaultConfigDescription);

      //
      // add the correct files to the project
      //
      mNewArduinoSketchWizardCodeSelectionPage.createFiles(project, monitor);
      //
      // add the libraries to the project if needed
      //
      mNewArduinoSketchWizardCodeSelectionPage.importLibraries(project, prjDesc.getConfigurations());

      ICResourceDescription cfgd = defaultConfigDescription.getResourceDescription(new Path(""), true);
      ICExclusionPatternPathEntry[] entries = cfgd.getConfiguration().getSourceEntries();
      if (entries.length == 1) {
    Path exclusionPath[] = new Path[2];
    exclusionPath[0] = new Path("Libraries/*/?xamples");
    exclusionPath[1] = new Path("Libraries/*/?xtras");
    ICExclusionPatternPathEntry newSourceEntry = new CSourceEntry(entries[0].getFullPath(), exclusionPath,
      ICSettingEntry.VALUE_WORKSPACE_PATH);
    ICSourceEntry[] out = null;
    out = new ICSourceEntry[1];
    out[0] = (ICSourceEntry) newSourceEntry;
    try {
        cfgd.getConfiguration().setSourceEntries(out);
    } catch (CoreException e) {
        // ignore
    }

      } else {
    // this should not happen
      }

      // set warning levels default on
      IEnvironmentVariableManager envManager = CCorePlugin.getDefault().getBuildEnvironmentManager();
      IContributedEnvironment contribEnv = envManager.getContributedEnvironment();
      IEnvironmentVariable var = new EnvironmentVariable(ArduinoConst.ENV_KEY_JANTJE_WARNING_LEVEL, ArduinoConst.ENV_KEY_WARNING_LEVEL_ON);
      contribEnv.addVariable(var, cfgd.getConfiguration());

      prjDesc.setActiveConfiguration(defaultConfigDescription);
      prjDesc.setCdtProjectCreated();
      CoreModel.getDefault().getProjectDescriptionManager().setProjectDescription(project, prjDesc, true, null);
      monitor.done();

  } catch (CoreException e) {
      Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Failed to create project " + project.getName(), e));
View Full Code Here

     * @author Jan Baeyens
     */
    @Override
    public boolean performFinish() {
  IProject project = mFolderSelectionPage.getProject();
  ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project);
  ICConfigurationDescription configurationDescriptions[] = projectDescription.getConfigurations();

  for (int curConfigurationDescription = 0; curConfigurationDescription < configurationDescriptions.length; curConfigurationDescription++) {
      try {
    ArduinoHelpers.addCodeFolder(project, new Path(mFolderSelectionPage.GetLibraryFolder()),
      configurationDescriptions[curConfigurationDescription]);
      } catch (CoreException e) {
    e.printStackTrace();
    IStatus status = new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Failed to import library ", e);
    Common.log(status);
    return false;
      }
      projectDescription.setActiveConfiguration(configurationDescriptions[curConfigurationDescription]);
      projectDescription.setCdtProjectCreated();
      try {
    CoreModel.getDefault().getProjectDescriptionManager().setProjectDescription(project, projectDescription, true, null);
      } catch (CoreException e) {
    Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Failed to import libraries to project " + project.getName(), e));
      }
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.