mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 547145 - Core build use of ProjectDescription should be synchronized
- synchronized core build project description manipulations using CoreModel as synchronization class Change-Id: Ic1312d5819ddc08acb492f57a2d87f1998329805
This commit is contained in:
parent
38a084ce6d
commit
19e4eabff2
4 changed files with 25 additions and 15 deletions
|
@ -281,9 +281,12 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IProjectDescription projectDesc = project.getDescription();
|
CoreModel m = CoreModel.getDefault();
|
||||||
projectDesc.setActiveBuildConfig(config.getName());
|
synchronized (m) {
|
||||||
project.setDescription(projectDesc, monitor);
|
IProjectDescription projectDesc = project.getDescription();
|
||||||
|
projectDesc.setActiveBuildConfig(config.getName());
|
||||||
|
project.setDescription(projectDesc, monitor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Preferences getSettings() {
|
protected Preferences getSettings() {
|
||||||
|
|
|
@ -160,15 +160,18 @@ public class CBuildConfigurationManager
|
||||||
String configName, IProgressMonitor monitor) throws CoreException {
|
String configName, IProgressMonitor monitor) throws CoreException {
|
||||||
String name = provider.getId() + '/' + configName;
|
String name = provider.getId() + '/' + configName;
|
||||||
|
|
||||||
Set<String> names = new HashSet<>();
|
CoreModel m = CoreModel.getDefault();
|
||||||
for (IBuildConfiguration config : project.getBuildConfigs()) {
|
synchronized (m) {
|
||||||
names.add(config.getName());
|
Set<String> names = new HashSet<>();
|
||||||
}
|
for (IBuildConfiguration config : project.getBuildConfigs()) {
|
||||||
|
names.add(config.getName());
|
||||||
|
}
|
||||||
|
|
||||||
IProjectDescription desc = project.getDescription();
|
IProjectDescription desc = project.getDescription();
|
||||||
names.add(name);
|
names.add(name);
|
||||||
desc.setBuildConfigs(names.toArray(new String[names.size()]));
|
desc.setBuildConfigs(names.toArray(new String[names.size()]));
|
||||||
project.setDescription(desc, monitor);
|
project.setDescription(desc, monitor);
|
||||||
|
}
|
||||||
|
|
||||||
return project.getBuildConfig(name);
|
return project.getBuildConfig(name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
|
||||||
Bundle-Version: 8.3.100.qualifier
|
Bundle-Version: 8.3.200.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
|
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.build.ICBuildConfiguration;
|
||||||
import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
|
import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
|
||||||
import org.eclipse.cdt.core.build.IToolChain;
|
import org.eclipse.cdt.core.build.IToolChain;
|
||||||
import org.eclipse.cdt.core.build.IToolChainManager;
|
import org.eclipse.cdt.core.build.IToolChainManager;
|
||||||
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.model.IBinary;
|
import org.eclipse.cdt.core.model.IBinary;
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
import org.eclipse.cdt.debug.internal.core.InternalDebugCoreMessages;
|
import org.eclipse.cdt.debug.internal.core.InternalDebugCoreMessages;
|
||||||
|
@ -139,9 +140,12 @@ public abstract class CoreBuildLaunchConfigDelegate extends LaunchConfigurationT
|
||||||
ICBuildConfiguration buildConfig = getBuildConfiguration(configuration, mode, target, monitor);
|
ICBuildConfiguration buildConfig = getBuildConfiguration(configuration, mode, target, monitor);
|
||||||
if (buildConfig != null) {
|
if (buildConfig != null) {
|
||||||
IProject project = getProject(configuration);
|
IProject project = getProject(configuration);
|
||||||
IProjectDescription desc = project.getDescription();
|
CoreModel m = CoreModel.getDefault();
|
||||||
desc.setActiveBuildConfig(buildConfig.getBuildConfiguration().getName());
|
synchronized (m) {
|
||||||
project.setDescription(desc, monitor);
|
IProjectDescription desc = project.getDescription();
|
||||||
|
desc.setActiveBuildConfig(buildConfig.getBuildConfiguration().getName());
|
||||||
|
project.setDescription(desc, monitor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// proceed with the build
|
// proceed with the build
|
||||||
|
|
Loading…
Add table
Reference in a new issue