1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 17:55:39 +02:00

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

This commit is contained in:
Sean Evoy 2004-06-04 20:45:51 +00:00
parent 5f5b6bc0d7
commit 98800badf4

View file

@ -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)
*/