mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 03:05: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:
parent
5f5b6bc0d7
commit
98800badf4
1 changed files with 14 additions and 2 deletions
|
@ -119,8 +119,7 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
ManagedBuilderUIPlugin.log(e);
|
ManagedBuilderUIPlugin.log(e);
|
||||||
}
|
}
|
||||||
String artifactName = newProject.getName();
|
newTarget.setArtifactName(getBuildGoalName());
|
||||||
newTarget.setArtifactName(artifactName);
|
|
||||||
IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations();
|
IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations();
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
r.setSeed(System.currentTimeMillis());
|
r.setSeed(System.currentTimeMillis());
|
||||||
|
@ -155,6 +154,19 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
|
||||||
monitor.done();
|
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)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#doRunPrologue(org.eclipse.core.runtime.IProgressMonitor)
|
* @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#doRunPrologue(org.eclipse.core.runtime.IProgressMonitor)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue