Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-06-04 20:45:51 +0000
committerSean Evoy2004-06-04 20:45:51 +0000
commit98800badf41d15b2ca0fc2860c3e7b21103c59e6 (patch)
treef3d6c7a0ec37e718d9d473f3c5d830009bab88ae /build/org.eclipse.cdt.managedbuilder.ui/src
parent5f5b6bc0d76595e4b92f22fb99ae2c6a05ae6e12 (diff)
downloadorg.eclipse.cdt-98800badf41d15b2ca0fc2860c3e7b21103c59e6.tar.gz
org.eclipse.cdt-98800badf41d15b2ca0fc2860c3e7b21103c59e6.tar.xz
org.eclipse.cdt-98800badf41d15b2ca0fc2860c3e7b21103c59e6.zip
Fix for bug 60230 - Project with spaces in name produces 2 executables. Since Eclipse does not treat this as illegal and since I am using the project name as the default build goal name, this is a legit bug. The solution is to remove all spaces from the project name, so a new project called "Hello World" will produce a build goal called HelloWorld
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
index 5a6591f306..bc2ed155d2 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
@@ -119,8 +119,7 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
} catch (CoreException e) {
ManagedBuilderUIPlugin.log(e);
}
- String artifactName = newProject.getName();
- newTarget.setArtifactName(artifactName);
+ newTarget.setArtifactName(getBuildGoalName());
IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations();
Random r = new Random();
r.setSeed(System.currentTimeMillis());
@@ -155,6 +154,19 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
monitor.done();
}
+ /**
+ * @return
+ */
+ private String getBuildGoalName() {
+ String name = new String();
+ // Check for spaces
+ String[] tokens = newProject.getName().split("\\s"); //$NON-NLS-1$
+ for (int index = 0; index < tokens.length; ++index) {
+ name += tokens[index];
+ }
+ return name;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#doRunPrologue(org.eclipse.core.runtime.IProgressMonitor)
*/

Back to the top