Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeff Johnston2019-05-15 20:41:14 -0400
committerJeff Johnston2019-05-15 20:41:14 -0400
commit86bfd4de7e477f0423585be531bef9a53f32aa6c (patch)
tree184afc72f8ec39e2e65518e6baba92e86a586a16 /core
parent949dd8a45f3758794707109bfddc6069c1ec3f98 (diff)
downloadorg.eclipse.cdt-86bfd4de7e477f0423585be531bef9a53f32aa6c.tar.gz
org.eclipse.cdt-86bfd4de7e477f0423585be531bef9a53f32aa6c.tar.xz
org.eclipse.cdt-86bfd4de7e477f0423585be531bef9a53f32aa6c.zip
Bug 547174 - Clean core project doesn't always show active in console
- order build config names so when clean for a project goes through the build configs, it finds the active one last and thus it will appear in the CDT build console - do this in CoreBuildLaunchbarTracker.setActiveBuildConfig() - do this in CBuildConfiguration.setActive() - do this in CoreBuildLaunchConfigDelegate.buildForLaunch() Change-Id: I379d6c9ba298f02cbc75d16e9941527cd2f9f45c
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
index 723ced6db4..1a508884f1 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
@@ -29,9 +29,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -284,6 +286,18 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu
CoreModel m = CoreModel.getDefault();
synchronized (m) {
IProjectDescription projectDesc = project.getDescription();
+ IBuildConfiguration[] bconfigs = project.getBuildConfigs();
+ Set<String> names = new LinkedHashSet<>();
+ for (IBuildConfiguration bconfig : bconfigs) {
+ names.add(bconfig.getName());
+ }
+ // must add default config name as it may not be in build config list
+ names.add(IBuildConfiguration.DEFAULT_CONFIG_NAME);
+ // ensure active config is last in list so clean build will clean
+ // active config last and this will be left in build console for user to see
+ names.remove(config.getName());
+ names.add(config.getName());
+
projectDesc.setActiveBuildConfig(config.getName());
project.setDescription(projectDesc, monitor);
}

Back to the top