1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug #185044: remove spaces in the build artifact name

This commit is contained in:
Oleg Krasilnikov 2007-05-02 15:29:10 +00:00
parent a0142f9148
commit 1f79e4583a
4 changed files with 15 additions and 4 deletions

View file

@ -16,6 +16,7 @@ import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.ui.wizards.CWizardHandler;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@ -117,7 +118,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
String s = fCfg.getArtifactName();
if (s == null || s.trim().length() == 0) {
s = getResDesc().getConfiguration().getProjectDescription().getName();
getCfg().setArtifactName(s);
getCfg().setArtifactName(CWizardHandler.removeSpaces(s));
}
t2.setText(s);

View file

@ -364,9 +364,8 @@ public class MBSWizardHandler extends CWizardHandler {
IBuilder bld = config.getEditableBuilder();
if (bld != null) { bld.setManagedBuildOn(true); }
String s = project.getName();
config.setName(cfgs[i].getName());
config.setArtifactName(s);
config.setArtifactName(removeSpaces(project.getName()));
IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY);
if (b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId()))

View file

@ -72,7 +72,7 @@ public class STDWizardHandler extends MBSWizardHandler {
} else {
System.out.println(UIMessages.getString("StdProjectTypeHandler.3")); //$NON-NLS-1$
}
cfg.setArtifactName(project.getName());
cfg.setArtifactName(removeSpaces(project.getName()));
CConfigurationData data = cfg.getConfigurationData();
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
}

View file

@ -189,4 +189,15 @@ public class CWizardHandler implements Cloneable {
return clone;
} catch (CloneNotSupportedException e) { return null; }
}
public static String removeSpaces(String s) {
char[] cs = s.toCharArray();
StringBuffer sb = new StringBuffer();
for (int i=0; i<cs.length; i++) {
if (Character.isWhitespace(cs[i]))
continue;
sb.append(cs[i]);
}
return sb.toString();
}
}