ICommand command = description.newCommand(); command.setBuilderName(builderID);
protected void setBuilder(final IProjectDescription projectDescription, final String[] builders) { List<ICommand> commands = Lists.newArrayList(); for (int i = 0; i < builders.length; i++) { ICommand command = projectDescription.newCommand(); command.setBuilderName(builders[i]); commands.add(command); } projectDescription.setBuildSpec(commands.toArray(new ICommand[commands.size()])); }
private ICommand createCommand(IProjectDescription description, String name, Map<String, String> arguments) { ICommand command = description.newCommand(); command.setBuilderName(name); command.setArguments(ImmutableMap.copyOf(arguments)); return command; }
private static ICommand toCommand(String name, Map<String, String> arguments, IProjectDescription description) { ICommand command = description.newCommand(); command.setBuilderName(name); command.setArguments(arguments); return command; } }
public static void addBuilders(IProject project, String[] id, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getDescription(); List<ICommand> newCommands = getCommands(desc, id); for (int i = 0; i < id.length; i++) { ICommand command = desc.newCommand(); command.setBuilderName(id[i]); newCommands.add(command); } setCommands(desc, newCommands); project.setDescription(desc, monitor); }
public void configure() throws CoreException { IProjectDescription desc = project.getDescription(); ICommand[] commands = desc.getBuildSpec(); for (int i = 0; i < commands.length; ++i) { if (commands[i].getBuilderName().equals(XtextBuilder.BUILDER_ID)) { return; } } ICommand[] newCommands = new ICommand[commands.length + 1]; System.arraycopy(commands, 0, newCommands, 1, commands.length); ICommand command = desc.newCommand(); command.setBuilderName(XtextBuilder.BUILDER_ID); newCommands[0] = command; desc.setBuildSpec(newCommands); project.setDescription(desc, null); }
public static void addBPMN2Builder(IJavaProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription description = project.getProject().getDescription(); ICommand[] commands = description.getBuildSpec(); ICommand[] newCommands = new ICommand[commands.length + 2]; System.arraycopy(commands, 0, newCommands, 0, commands.length); ICommand bpmn2BuilderCommand = description.newCommand(); bpmn2BuilderCommand.setBuilderName("org.eclipse.bpmn2.modeler.core.bpmn2Builder"); newCommands[commands.length] = bpmn2BuilderCommand; ICommand wstValidationCommand = description.newCommand(); wstValidationCommand.setBuilderName("org.eclipse.wst.validation.validationbuilder"); newCommands[commands.length+1] = wstValidationCommand; description.setBuildSpec(newCommands); project.getProject().setDescription(description, monitor); }
public static void addBuilder(IProject project, String builderId) throws CoreException { IProjectDescription description = project.getDescription(); ICommand[] specs = description.getBuildSpec(); ICommand command = description.newCommand(); command.setBuilderName(builderId); // Add the nature ICommand[] specsModified = new ICommand[specs.length + 1]; System.arraycopy(specs, 0, specsModified, 0, specs.length); specsModified[specs.length] = command; description.setBuildSpec(specsModified); project.setDescription(description, monitor()); }
public static void addBuilder(IProject project, String builderId) throws CoreException { IProjectDescription description = project.getDescription(); ICommand[] specs = description.getBuildSpec(); ICommand command = description.newCommand(); command.setBuilderName(builderId); // Add the nature ICommand[] specsModified = new ICommand[specs.length + 1]; System.arraycopy(specs, 0, specsModified, 0, specs.length); specsModified[specs.length] = command; description.setBuildSpec(specsModified); project.setDescription(description, monitor()); }
protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = getProject().getDescription(); ICommand builderCommand = getBuilderCommand(description, builderID); if (builderCommand == null) { // Add a new build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setBuilderCommand(description, command); } }
protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = getProject().getDescription(); ICommand builderCommand = getBuilderCommand(description, builderID); if (builderCommand == null) { // Add a new build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setBuilderCommand(description, command); } }
public static void addMavenBuilder(IJavaProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription description = project.getProject().getDescription(); ICommand[] commands = description.getBuildSpec(); ICommand[] newCommands = new ICommand[commands.length + 1]; System.arraycopy(commands, 0, newCommands, 0, commands.length); ICommand mavenCommand = description.newCommand(); mavenCommand.setBuilderName("org.eclipse.m2e.core.maven2Builder"); newCommands[commands.length] = mavenCommand; description.setBuildSpec(newCommands); project.getProject().setDescription(description, monitor); }
public static void addJavaBuilder(IJavaProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription description = project.getProject().getDescription(); ICommand[] commands = description.getBuildSpec(); ICommand[] newCommands = new ICommand[commands.length + 1]; System.arraycopy(commands, 0, newCommands, 0, commands.length); ICommand javaCommand = description.newCommand(); javaCommand.setBuilderName("org.eclipse.jdt.core.javabuilder"); newCommands[commands.length] = javaCommand; description.setBuildSpec(newCommands); project.getProject().setDescription(description, monitor); }
/** * Adds a builder to the build spec for the given project. */ protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = this.project.getDescription(); int javaCommandIndex = getJavaCommandIndex(description.getBuildSpec()); if (javaCommandIndex == -1) { // Add a Java command to the build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setJavaCommand(description, command); } } /**
/** * Adds a builder to the build spec for the given project. */ protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = this.project.getDescription(); int javaCommandIndex = getJavaCommandIndex(description.getBuildSpec()); if (javaCommandIndex == -1) { // Add a Java command to the build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setJavaCommand(description, command); } } /**
/** * Adds a builder to the build spec for the given project. */ protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = this.project.getDescription(); int javaCommandIndex = getJavaCommandIndex(description.getBuildSpec()); if (javaCommandIndex == -1) { // Add a Java command to the build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setJavaCommand(description, command); } } /**
/** * Adds a builder to the build spec for the given project. */ protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = this.project.getDescription(); int javaCommandIndex = getJavaCommandIndex(description.getBuildSpec()); if (javaCommandIndex == -1) { // Add a Java command to the build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setJavaCommand(description, command); } } /**
/** * Adds a builder to the build spec for the given project. */ protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = this.project.getDescription(); int javaCommandIndex = getJavaCommandIndex(description.getBuildSpec()); if (javaCommandIndex == -1) { // Add a Java command to the build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setJavaCommand(description, command); } } /**
/** * Adds a builder to the build spec for the given project. */ protected void addToBuildSpec(String builderID) throws CoreException { IProjectDescription description = this.project.getDescription(); int javaCommandIndex = getJavaCommandIndex(description.getBuildSpec()); if (javaCommandIndex == -1) { // Add a Java command to the build spec ICommand command = description.newCommand(); command.setBuilderName(builderID); setJavaCommand(description, command); } } /**
/** * Add the new AspectJ Builder to the given project */ public static void addNewBuilder(IProject project) throws CoreException { IProjectDescription description = project.getDescription(); ICommand[] buildCommands = description.getBuildSpec(); if (!contains(buildCommands, AspectJPlugin.ID_BUILDER)) { ICommand command = description.newCommand(); command.setBuilderName(AspectJPlugin.ID_BUILDER); ICommand[] newBuildCommands = insert(buildCommands, command); description.setBuildSpec(newBuildCommands); project.setDescription(description, null); } }