1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

Bug 547104 - Adding new Docker Connection causes two build dirs

- change createBuildConfiguration() method in providers:
  MesonBuildConfigurationProvider, CMakeBuildConfigurationProvider,
  AutotoolsBuildConfigurationProvider,MakefileBuildConfigurationProvider
  to not create a .x config name and instead use the found
  IBuildConfiguration so the new CBuildConfiguration will be
  overridden in the CBuildConfigurationManager

Change-Id: Ia5f460e879f3412f19a9dec7b88dd392714b54ca
This commit is contained in:
Jeff Johnston 2019-05-16 21:58:27 -04:00
parent 74e63a9013
commit b5af112f86
4 changed files with 39 additions and 20 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2016 QNX Software Systems and others. * Copyright (c) 2016, 2019 QNX Software Systems and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -126,12 +126,17 @@ public class CMakeBuildConfigurationProvider implements ICBuildConfigurationProv
} }
} }
String name = configName.toString(); String name = configName.toString();
int i = 0; IBuildConfiguration config = null;
while (configManager.hasConfiguration(this, project, name)) { // reuse any IBuildConfiguration with the same name for the project
name = configName.toString() + '.' + (++i); // so adding the CBuildConfiguration will override the old one stored
// by the CBuildConfigurationManager
if (configManager.hasConfiguration(this, project, name)) {
config = project.getBuildConfig(this.getId() + '/' + name);
}
if (config == null) {
config = configManager.createBuildConfiguration(this, project, name, monitor);
} }
IBuildConfiguration config = configManager.createBuildConfiguration(this, project, name, monitor);
CMakeBuildConfiguration cmakeConfig = new CMakeBuildConfiguration(config, name, toolChain, file, launchMode); CMakeBuildConfiguration cmakeConfig = new CMakeBuildConfiguration(config, name, toolChain, file, launchMode);
configManager.addBuildConfiguration(config, cmakeConfig); configManager.addBuildConfiguration(config, cmakeConfig);
return cmakeConfig; return cmakeConfig;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 Intel Corporation and others. * Copyright (c) 2017, 2019 Intel Corporation and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -111,12 +111,17 @@ public class AutotoolsBuildConfigurationProvider implements ICBuildConfiguration
} }
} }
String name = configName.toString(); String name = configName.toString();
int i = 0; IBuildConfiguration config = null;
while (configManager.hasConfiguration(this, project, name)) { // reuse any IBuildConfiguration with the same name for the project
name = configName.toString() + '.' + (++i); // so adding the CBuildConfiguration will override the old one stored
// by the CBuildConfigurationManager
if (configManager.hasConfiguration(this, project, name)) {
config = project.getBuildConfig(this.getId() + '/' + name);
}
if (config == null) {
config = configManager.createBuildConfiguration(this, project, name, monitor);
} }
IBuildConfiguration config = configManager.createBuildConfiguration(this, project, name, monitor);
AutotoolsBuildConfiguration autotoolsConfig = new AutotoolsBuildConfiguration(config, name, toolChain, AutotoolsBuildConfiguration autotoolsConfig = new AutotoolsBuildConfiguration(config, name, toolChain,
launchMode); launchMode);
configManager.addBuildConfiguration(config, autotoolsConfig); configManager.addBuildConfiguration(config, autotoolsConfig);

View file

@ -95,12 +95,16 @@ public class MakefileBuildConfigurationProvider implements ICBuildConfigurationP
} }
} }
String name = configName.toString(); String name = configName.toString();
int i = 0; IBuildConfiguration config = null;
while (configManager.hasConfiguration(this, project, name)) { // reuse any IBuildConfiguration with the same name for the project
name = configName.toString() + '.' + (++i); // so adding the CBuildConfiguration will override the old one stored
// by the CBuildConfigurationManager
if (configManager.hasConfiguration(this, project, name)) {
config = project.getBuildConfig(this.getId() + '/' + name);
}
if (config == null) {
config = configManager.createBuildConfiguration(this, project, name, monitor);
} }
IBuildConfiguration config = configManager.createBuildConfiguration(this, project, name, monitor);
StandardBuildConfiguration makeConfig = new StandardBuildConfiguration(config, name, toolChain, launchMode); StandardBuildConfiguration makeConfig = new StandardBuildConfiguration(config, name, toolChain, launchMode);
configManager.addBuildConfiguration(config, makeConfig); configManager.addBuildConfiguration(config, makeConfig);
return makeConfig; return makeConfig;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2016, 2018 QNX Software Systems and others. * Copyright (c) 2016, 2019 QNX Software Systems and others.
* *
* This program and the accompanying materials * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 * are made available under the terms of the Eclipse Public License 2.0
@ -129,12 +129,17 @@ public class MesonBuildConfigurationProvider implements ICBuildConfigurationProv
} }
} }
String name = configName.toString(); String name = configName.toString();
int i = 0; IBuildConfiguration config = null;
while (configManager.hasConfiguration(this, project, name)) { // reuse any IBuildConfiguration with the same name for the project
name = configName.toString() + '.' + (++i); // so adding the CBuildConfiguration will override the old one stored
// by the CBuildConfigurationManager
if (configManager.hasConfiguration(this, project, name)) {
config = project.getBuildConfig(this.getId() + '/' + name);
}
if (config == null) {
config = configManager.createBuildConfiguration(this, project, name, monitor);
} }
IBuildConfiguration config = configManager.createBuildConfiguration(this, project, name, monitor);
MesonBuildConfiguration mesonConfig = new MesonBuildConfiguration(config, name, toolChain, file, launchMode); MesonBuildConfiguration mesonConfig = new MesonBuildConfiguration(config, name, toolChain, file, launchMode);
configManager.addBuildConfiguration(config, mesonConfig); configManager.addBuildConfiguration(config, mesonConfig);
return mesonConfig; return mesonConfig;