Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java49
1 files changed, 26 insertions, 23 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
index 143b0e6a1d1..3d62a11e4bd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
@@ -271,18 +271,28 @@ public class HeadlessBuilder implements IApplication {
/*
* Build the given configurations using the specified build type (FULL, CLEAN, INCREMENTAL)
*/
- protected void buildConfigurations(Map<IProject, Set<ICConfigurationDescription>> projConfigs,
- final IProgressMonitor monitor, final int buildType) throws CoreException {
+ protected boolean buildConfigurations(Map<IProject, Set<ICConfigurationDescription>> projConfigs,
+ final IProgressMonitor monitor, final int buildType, List<String> allBuildErrors) throws CoreException {
+ boolean buildSuccessful = true;
for (Map.Entry<IProject, Set<ICConfigurationDescription>> entry : projConfigs.entrySet()) {
Set<ICConfigurationDescription> cfgDescs = entry.getValue();
- IConfiguration[] configs = new IConfiguration[cfgDescs.size()];
- int i = 0;
- for (ICConfigurationDescription cfgDesc : cfgDescs)
- configs[i++] = ManagedBuildManager.getConfigurationForDescription(cfgDesc);
+ for (ICConfigurationDescription cfgDesc : cfgDescs) {
+ IConfiguration[] configs = new IConfiguration[] {
+ ManagedBuildManager.getConfigurationForDescription(cfgDesc) };
+
+ ManagedBuildManager.buildConfigurations(configs, null, new SubProgressMonitor(monitor, 1), true,
+ buildType);
+
+ buildSuccessful = buildSuccessful && isProjectSuccesfullyBuild(entry.getKey());
+ if (printErrorMarkers) {
+ accumulateErrorMarkers(entry.getKey(), allBuildErrors);
+ }
+ }
- ManagedBuildManager.buildConfigurations(configs, null, new SubProgressMonitor(monitor, 1), true, buildType);
}
+
+ return buildSuccessful;
}
/**
@@ -538,7 +548,8 @@ public class HeadlessBuilder implements IApplication {
for (String regEx : projectRegExToClean)
matchConfigurations(regEx, allProjects, configsToBuild);
// Clean the list of configurations
- buildConfigurations(configsToBuild, monitor, IncrementalProjectBuilder.CLEAN_BUILD);
+ buildConfigurations(configsToBuild, monitor, IncrementalProjectBuilder.CLEAN_BUILD,
+ new ArrayList<>());
}
// Build the projects the user wants building
@@ -547,26 +558,18 @@ public class HeadlessBuilder implements IApplication {
ACBuilder.setAllConfigBuild(true);
System.out.println(HeadlessBuildMessages.HeadlessBuilder_building_all);
- root.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- for (IProject p : root.getProjects()) {
- buildSuccessful = buildSuccessful && isProjectSuccesfullyBuild(p);
- if (printErrorMarkers) {
- accumulateErrorMarkers(p, allBuildErrors);
- }
- }
+
+ // Collect build configurations for all projects in workspace
+ matchConfigurations(".*", allProjects, configsToBuild); //$NON-NLS-1$
} else {
// Resolve the regular expression project names to build configurations
for (String regEx : projectRegExToBuild)
matchConfigurations(regEx, allProjects, configsToBuild);
- // Build the list of configurations
- buildConfigurations(configsToBuild, monitor, IncrementalProjectBuilder.FULL_BUILD);
- for (IProject p : configsToBuild.keySet()) {
- buildSuccessful = buildSuccessful && isProjectSuccesfullyBuild(p);
- if (printErrorMarkers) {
- accumulateErrorMarkers(p, allBuildErrors);
- }
- }
}
+
+ // Build the list of configurations
+ buildSuccessful = buildConfigurations(configsToBuild, monitor, IncrementalProjectBuilder.FULL_BUILD,
+ allBuildErrors);
} finally {
// Reset the tool options
if (!savedToolOptions.isEmpty())

Back to the top