private ICommand getBuilderCommand(IProjectDescription description, String builderId) throws CoreException { ICommand[] commands = description.getBuildSpec(); for (int i = 0; i < commands.length; ++i) { if (commands[i].getBuilderName().equals(builderId)) { return commands[i]; } } return null; }
protected ICommand getLibCopyBuilder(IProjectDescription description) throws CoreException { if (description == null) { return null; } ICommand[] commands = description.getBuildSpec(); for (int i = 0; i < commands.length; ++i) { if (commands[i].getBuilderName().equals(LibCopyBuilder.BUILDER_ID)) { return commands[i]; } } return null; }
private ICommand getBuilderCommand(IProjectDescription description, String builderId) { ICommand[] commands = description.getBuildSpec(); for (int i = 0; i < commands.length; ++i) { if (commands[i].getBuilderName().equals(builderId)) { return commands[i]; } } return null; }
private boolean isBuildEnabled(IProject project) { try { for (ICommand command : project.getDescription().getBuildSpec()) { if (XtextBuilder.BUILDER_ID.equals(command.getBuilderName())) { return true; } } } catch (CoreException e) { log.error("Can't build due to an exception.", e); } return false; }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }
public static final boolean hasBuilder(final IProject project) { try { for (final ICommand buildSpec : project.getDescription().getBuildSpec()) { if (IncrementalDotnetBuilder.BUILDER_ID.equals(buildSpec.getBuilderName())) { return true; } } } catch (final CoreException e) { } return false; } }
public static boolean hasNewBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); return contains(buildCommands, AspectJPlugin.ID_BUILDER); }
public static String getPath(IProject project, String argument) { try { for (final ICommand command : project.getDescription().getBuildSpec()) { if (isFIDEBuilder(command)) { return command.getArguments().get(argument); } } } catch (final CoreException e) { Logger.logError(e); } return null; }
public static void update(IProject project, List<EclipseBuildCommand> buildCommands, PersistentModelBuilder persistentModel, IProgressMonitor monitor) throws CoreException { IProjectDescription description = project.getDescription(); Set<ICommand> current = ImmutableSet.copyOf(description.getBuildSpec()); Set<ICommand> model = toCommands(buildCommands, description); PersistentModel previousModel = persistentModel.getPrevious(); Set<ICommand> managed = previousModel.isPresent() ? Sets.newLinkedHashSet(previousModel.getManagedBuilders()) : Sets.<ICommand>newLinkedHashSet(); Result<ICommand> result = ManagedModelMergingStrategy.calculate(current, model, managed); description.setBuildSpec(result.getNextElements().toArray(new ICommand[0])); project.setDescription(description, monitor); persistentModel.managedBuilders(result.getNextManaged()); }
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()); }
/** * Remove the old AspectJ Builder from the given project */ public static void removeOldBuilder(IProject project) throws CoreException { IProjectDescription description = project.getDescription(); ICommand[] buildCommands = description.getBuildSpec(); if (contains(buildCommands, OLD_BUILDER)) { ICommand[] newBuildCommands = remove(buildCommands, OLD_BUILDER); description.setBuildSpec(newBuildCommands); project.setDescription(description, null); } }
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); } } /**