/** * Returns whether one of the projects has a builder whose trigger setting * for the given trigger matches the given value. * * @param projects The projects to check * @param trigger The trigger to look for * @param value The trigger value to look for * @return <code>true</code> if one of the projects has a builder whose * trigger activation matches the provided value, and <code>false</code> otherwise. */ private static boolean matchingTrigger(IProject[] projects, int trigger, boolean value) { for (int i = 0; i < projects.length; i++) { if (!projects[i].isAccessible()) { continue; } try { IProjectDescription description = projects[i].getDescription(); ICommand[] buildSpec = description.getBuildSpec(); for (int j = 0; j < buildSpec.length; j++) { if (buildSpec[j].isBuilding(trigger) == value) { return true; } } } catch (CoreException e) { //ignore projects that are not available } } return false; }
boolean isBuilding = builder.getCommand().isBuilding(trigger); isBuilding = isBuilding || builder.getCommand().isBuilding(trigger);
boolean isBuilding = builder.getCommand().isBuilding(trigger); isBuilding = isBuilding || builder.getCommand().isBuilding(trigger);
boolean isBuilding = builder.getCommand().isBuilding(trigger); isBuilding = isBuilding || builder.getCommand().isBuilding(trigger);
private boolean commandConfiguredForKind(ILaunchConfiguration config, int kind) { try { if (!(config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) { ICommand command= getCommand(); //adapt the builder command to make use of the 3.1 support for setting command build kinds //this will only happen once for builder/command defined before the support existed BuilderCoreUtils.configureTriggers(config, command); IProjectDescription desc= getProject().getDescription(); ICommand[] commands= desc.getBuildSpec(); int index= getBuilderCommandIndex(commands, command); if (index != -1) { commands[index]= command; desc.setBuildSpec(commands); getProject().setDescription(desc, null); ILaunchConfigurationWorkingCopy copy= config.getWorkingCopy(); copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true); copy.doSave(); } return command.isBuilding(kind); } } catch (CoreException e) { ExternalToolsCore.log(e); return true; } return true; }