Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ICommand


      ICommand[] commands = desc.getBuildSpec();
      for (int i = 0; i < commands.length; ++i)
        if (commands[i].getBuilderName().equals(id))
          return;
      //add builder to project
      ICommand command = desc.newCommand();
      command.setBuilderName(id);
      ICommand[] nc = new ICommand[commands.length + 1];
      // Add it before other builders.
      System.arraycopy(commands, 0, nc, 1, commands.length);
      nc[0] = command;
      desc.setBuildSpec(nc);
View Full Code Here


      }
    }

    ICommand[] newCommands = new ICommand[commands.length + 1];
    System.arraycopy(commands, 0, newCommands, 0, commands.length);
    ICommand command = desc.newCommand();
    command.setBuilderName(ToolBuilder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

      }
    }

    ICommand[] newCommands = new ICommand[commands.length + 1];
    System.arraycopy(commands, 0, newCommands, 0, commands.length);
    ICommand command = desc.newCommand();
    command.setBuilderName(QWickieBuilder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

    IProjectDescription description = project.getDescription();
    ICommand[] oldBuilders = description.getBuildSpec();
    ICommand[] newBuilders = new ICommand[oldBuilders.length-1];
    int i=0;
    for (int j = 0; j < oldBuilders.length; j++) {
      ICommand aCommand = oldBuilders[j];
      if(!aCommand.getBuilderName().equals(Constants.BUILDER_ID))
        newBuilders[i++] = aCommand;
    }

    description.setBuildSpec(newBuilders);
    project.setDescription(description, IResource.FORCE, null);
View Full Code Here

    IProjectDescription description = project.getDescription();
    ICommand[] oldBuilders = description.getBuildSpec();
    ICommand[] newBuilders = new ICommand[oldBuilders.length - 1];
    int i = 0;
    for (int j = 0; j < oldBuilders.length; j++) {
      ICommand aCommand = oldBuilders[j];
      if (!aCommand.getBuilderName().equals(Constants.BUILDER_ID))
        newBuilders[i++] = aCommand;
    }

    description.setBuildSpec(newBuilders);
    project.setDescription(description, IResource.FORCE, null);
View Full Code Here

      }
    }

    ICommand[] newCommands = new ICommand[commands.length + 1];
    System.arraycopy(commands, 0, newCommands, 0, commands.length);
    ICommand command = desc.newCommand();
    command.setBuilderName(FscriptBuilder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

        subM.worked(sub_work);
      }
      work /= 2;
    }

    ICommand xvrBuilder = XVRUtils.getXVRBuilderCommand(p);
    Map<String, String> args = XVRUtils.getBuilderArgs(p);
    args.put(XVRConstants.BUILD_MODE, mode);
    xvrBuilder.setArguments(args);

    p.build(IncrementalProjectBuilder.FULL_BUILD, xvrBuilder.getBuilderName(), xvrBuilder.getArguments(), subM.newChild(work));
    subM.worked(work);
  }
View Full Code Here

      throw new ExecutionException("Error while retrieving the project description: " + e.getMessage());
    }
   
    ICommand[] commands = desc.getBuildSpec();
    boolean found = false;
    ICommand builder = null;
    ArrayList<ICommand> list = new ArrayList<ICommand>();
   
    for (int i = 0; i < commands.length; ++i){
      if ((found = commands[i].getBuilderName().equals(XVRBuilder.BUILDER_ID)))
        builder = commands[i];
      else
        list.add(commands[i]);
    }
    if(!found)
      throw new ExecutionException("Builder not found while setting main file");
   
   
    Map<String, String> arg = builder.getArguments();
   
    IResource res = (IResource)((IAdaptable) element).getAdapter(IResource.class);
    //String location = res.getProjectRelativePath().toString();//OSString();
    String location = res.getProjectRelativePath().toOSString();
    arg.put(XVRProjectSupport.ARG_MAIN_KEY, location);
    builder.setArguments(arg);
    list.add(builder);
    desc.setBuildSpec(list.toArray(new ICommand[list.size()]));
    try {
      prj.setDescription(desc,(IProject.KEEP_HISTORY | IProject.AVOID_NATURE_CONFIG), null);
    } catch (CoreException e) {
View Full Code Here

    Assert.assertNotNull(main_html);
    Assert.assertNotNull(main_s3d);

    //add builder to project
    ICommand command = desc.newCommand();
    command.setBuilderName(XVRBuilder.BUILDER_ID);
    //Here we have to create builder command arguments(compiler and include locations)
    Map<String, String> args = new HashMap<String, String>();
    args.put(ARG_COMPILER_KEY, ARG_COMPILER_VAL);
    args.put(ARG_INCLUDE_KEY, ARG_INCLUDE_VAL);
    args.put(ARG_MAIN_KEY, main_s3d);
    args.put(ARG_MAIN_HTML_KEY, main_html);
    args.put(ARG_GLUT, ARG_GLUT_VAL);
    args.put(ARG_FS, ARG_FS_VAL);
    args.put(ARG_PARAM_FILE_KEY, ARG_PARAM_FILE_VAL);
    args.put(ARG_GLUT_PARAM_KEY, ARG_GLUT_PARAM_VAL);
    args.put(ARG_GLUT_PARAM_ACTIVE_KEY, ARG_GLUT_PARAM_ACTIVE_VAL);
    args.put(ARG_INCLUDE_DIRS_PARAM_KEY, ARG_INCLUDE_DIRS_PARAM_VAL);
   
    command.setArguments(args);
    desc.setBuildSpec(new ICommand[]{command});
    try {
      newProject.create(desc, new NullProgressMonitor());
      if (!newProject.isOpen())
        newProject.open(new NullProgressMonitor());
View Full Code Here

        break;
      }
    }
    if (!found) {
      //add builder to project
      ICommand command = desc.newCommand();
      command.setBuilderName(XVRBuilder.BUILDER_ID);
      //Here we have to create builder command arguments(compiler and include locations)
      Map<String, String> args = new HashMap<String, String>();
      args.put(ARG_COMPILER_KEY, ARG_COMPILER_VAL);
      args.put(ARG_INCLUDE_KEY, ARG_INCLUDE_VAL);
      args.put(ARG_MAIN_KEY, main_location);
      args.put(ARG_MAIN_HTML_KEY, main_html);
      args.put(ARG_GLUT, ARG_GLUT_VAL);
      args.put(ARG_FS, ARG_FS_VAL);
      args.put(ARG_PARAM_FILE_KEY, ARG_PARAM_FILE_VAL);
      args.put(ARG_GLUT_PARAM_KEY, ARG_GLUT_PARAM_VAL);
      args.put(ARG_GLUT_PARAM_ACTIVE_KEY, ARG_GLUT_PARAM_ACTIVE_VAL);
      args.put(ARG_INCLUDE_DIRS_PARAM_KEY, ARG_INCLUDE_DIRS_PARAM_VAL);

      command.setArguments(args);
      ICommand[] newCommands = new ICommand[commands.length + 1];

      // Add it before other builders.
      System.arraycopy(commands, 0, newCommands, 1, commands.length);
      newCommands[0] = command;
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.ICommand

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.