mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Apply patch from 130170 - Issues with handling version information while generating IDs
This commit is contained in:
parent
7f33784eff
commit
2f7eba1275
4 changed files with 2322 additions and 2324 deletions
|
@ -337,7 +337,7 @@ public class Configuration extends BuildObject implements IConfiguration {
|
|||
Iterator iter = resElements.listIterator();
|
||||
while (iter.hasNext()) {
|
||||
ResourceConfiguration resConfig = (ResourceConfiguration) iter.next();
|
||||
subId = getId() + "." + ManagedBuildManager.getRandomNumber(); //$NON-NLS-1$
|
||||
subId = ManagedBuildManager.calculateChildId(getId(), resConfig.getResourcePath());
|
||||
ResourceConfiguration newResConfig = new ResourceConfiguration(this, resConfig, subId);
|
||||
addResourceConfiguration(newResConfig);
|
||||
}
|
||||
|
@ -974,7 +974,7 @@ public class Configuration extends BuildObject implements IConfiguration {
|
|||
return parent.getCleanCommand();
|
||||
} else {
|
||||
// User forgot to specify it. Guess based on OS.
|
||||
if (Platform.getOS().equals("OS_WIN32")) { //$NON-NLS-1$
|
||||
if (Platform.getOS().equals(Platform.OS_WIN32)) {
|
||||
return new String("del"); //$NON-NLS-1$
|
||||
} else {
|
||||
return new String("rm"); //$NON-NLS-1$
|
||||
|
@ -1486,5 +1486,4 @@ public class Configuration extends BuildObject implements IConfiguration {
|
|||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -528,7 +528,13 @@ public class HoldsOptions extends BuildObject implements IHoldsOptions {
|
|||
}
|
||||
// Create a new extension Option element
|
||||
String subId;
|
||||
subId = newSuperClass.getId() + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
String version = ManagedBuildManager.getVersionFromIdAndVersion(newSuperClass.getId());
|
||||
String baseId = ManagedBuildManager.getIdFromIdAndVersion(newSuperClass.getId());
|
||||
if ( version != null) {
|
||||
subId = baseId + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()) + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
subId = baseId + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()); //$NON-NLS-1$
|
||||
}
|
||||
setOption = createOption(newSuperClass, subId, null, true);
|
||||
((Option)setOption).setAdjusted(true);
|
||||
setOption.setValueType(option.getValueType());
|
||||
|
@ -552,8 +558,7 @@ public class HoldsOptions extends BuildObject implements IHoldsOptions {
|
|||
}
|
||||
// Create an Option element for the managed build project file (.CDTBUILD)
|
||||
String subId;
|
||||
int nnn = ManagedBuildManager.getRandomNumber();
|
||||
subId = newSuperClass.getId() + "." + nnn; //$NON-NLS-1$
|
||||
subId = ManagedBuildManager.calculateChildId(newSuperClass.getId(), null);
|
||||
setOption = createOption(newSuperClass, subId, null, false);
|
||||
setOption.setValueType(option.getValueType());
|
||||
}
|
||||
|
|
|
@ -394,7 +394,7 @@ public class Target extends BuildObject implements ITarget {
|
|||
return parent.getCleanCommand();
|
||||
} else {
|
||||
// User forgot to specify it. Guess based on OS.
|
||||
if (Platform.getOS().equals("OS_WIN32")) { //$NON-NLS-1$
|
||||
if (Platform.getOS().equals(Platform.OS_WIN32)) {
|
||||
return new String("del"); //$NON-NLS-1$
|
||||
} else {
|
||||
return new String("rm"); //$NON-NLS-1$
|
||||
|
|
|
@ -55,8 +55,6 @@ public class NewConfigurationDialog extends StatusDialog {
|
|||
private static final String INVALID = ERROR + ".invalidName"; //$NON-NLS-1$
|
||||
private static final String DESCRIPTION = LABEL + ".description"; //$NON-NLS-1$
|
||||
|
||||
private static final String ID_SEPARATOR = "."; //$NON-NLS-1$
|
||||
|
||||
// Widgets
|
||||
private Button btnClone;
|
||||
private Button btnCopy;
|
||||
|
@ -549,23 +547,19 @@ public class NewConfigurationDialog extends StatusDialog {
|
|||
* the dialog.
|
||||
*/
|
||||
public IConfiguration newConfiguration(IManagedBuildInfo info) {
|
||||
int id = ManagedBuildManager.getRandomNumber();
|
||||
|
||||
// Create ID for the new component based on the parent ID and random component
|
||||
String newId = parentConfig.getId();
|
||||
int index = newId.lastIndexOf(ID_SEPARATOR);
|
||||
if (index > 0) {
|
||||
String lastComponent = newId.substring(index + 1, newId.length());
|
||||
if (Character.isDigit(lastComponent.charAt(0))) {
|
||||
// Strip the last component
|
||||
newId = newId.substring(0, index);
|
||||
}
|
||||
}
|
||||
newId += ID_SEPARATOR + id;
|
||||
String newId = null;
|
||||
IConfiguration newConfig;
|
||||
|
||||
if (parentConfig.isExtensionElement()) {
|
||||
// If parent config is an extension element,
|
||||
// Create ID for the new component based on the parentConfig's id and random component
|
||||
newId = ManagedBuildManager.calculateChildId(parentConfig.getId(), null);
|
||||
newConfig = info.getManagedProject().createConfiguration(parentConfig, newId);
|
||||
} else {
|
||||
// If parent config is not an extension element, then
|
||||
// Create ID for the new component based on the parentConfig's parent id and random component
|
||||
newId = ManagedBuildManager.calculateChildId(parentConfig.getParent().getId(), null);
|
||||
newConfig = info.getManagedProject().createConfigurationClone(parentConfig, newId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue