[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] patches for version support ( bugzilla #89872)
|
Title: patches for version support ( bugzilla #89872)
Hi,
Here I attached patches for version support in Managed Build system.
Thanks & Regards,
Sunil
<<mbs_ui_05_25_05_patch.txt>> <<mbs_core_05_25_05_patch.txt>>
Index: src/org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java,v
retrieving revision 1.3
diff -u -r1.3 BuildSettingsBlock.java
--- src/org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java 19 May 2005 16:22:49 -0000 1.3
+++ src/org/eclipse/cdt/managedbuilder/internal/ui/BuildSettingsBlock.java 25 May 2005 17:38:57 -0000
@@ -377,7 +377,17 @@
if (builder.isExtensionElement()) {
IToolChain tc = selectedConfiguration.getToolChain();
int nnn = ManagedBuildManager.getRandomNumber();
- String subId = builder.getId() + "." + nnn; //$NON-NLS-1$
+ String subId;
+ String tmpId;
+ String version;
+
+ tmpId = builder.getId();
+ version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ if ( version != null) { // If the 'tmpId' contains version information
+ subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ subId = tmpId + "." + nnn; //$NON-NLS-1$
+ }
String name = builder.getName() + "." + selectedConfiguration.getName(); //$NON-NLS-1$
tc.createBuilder(builder, subId, name, false);
}
Index: src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java,v
retrieving revision 1.3
diff -u -r1.3 IBuildObject.java
--- src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java 24 Jun 2004 15:56:06 -0000 1.3
+++ src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java 25 May 2005 18:20:34 -0000
@@ -10,12 +10,16 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.core;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
+
public interface IBuildObject {
// Schema element names
public static final String ID = "id"; //$NON-NLS-1$
public static final String NAME = "name"; //$NON-NLS-1$
-
+
public String getId();
public String getName();
-
+ public PluginVersionIdentifier getVersion();
+ public void setVersion(PluginVersionIdentifier version);
+ public String getManagedBuildRevision();
}
Index: src/org/eclipse/cdt/managedbuilder/core/ITarget.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java,v
retrieving revision 1.14
diff -u -r1.14 ITarget.java
--- src/org/eclipse/cdt/managedbuilder/core/ITarget.java 4 Nov 2004 16:56:27 -0000 1.14
+++ src/org/eclipse/cdt/managedbuilder/core/ITarget.java 25 May 2005 18:20:34 -0000
@@ -291,9 +291,9 @@
/**
* Converts a CDT V2.0 target into a ProjectType + Configuration + Toolchain +
* Builder + TargetPlatform.
- *
+ * @param managedBuildRevision
*/
- public void convertToProjectType();
+ public void convertToProjectType(String managedBuildRevision);
/**
* Returns the <code>ProjectType</code> that this Target has been converted to,
Index: src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java,v
retrieving revision 1.42
diff -u -r1.42 ManagedBuildManager.java
--- src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java 19 May 2005 16:19:09 -0000 1.42
+++ src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java 25 May 2005 18:20:35 -0000
@@ -1342,7 +1342,7 @@
NodeList nodes = document.getElementsByTagName(ROOT_NODE_NAME);
if (nodes.getLength() > 0) {
Node node = nodes.item(0);
- buildInfo = new ManagedBuildInfo(project, (Element)node);
+ buildInfo = new ManagedBuildInfo(project, (Element)node, fileVersion);
if (fileVersion != null) {
buildInfo.setVersion(fileVersion);
}
@@ -1424,7 +1424,20 @@
// reflects the content and structure of the extension section within the
// declaring plug-in's manifest (plugin.xml) file.
IConfigurationElement[] elements = extension.getConfigurationElements();
- loadConfigElements(DefaultManagedConfigElement.convertArray(elements));
+ String revision = null;
+
+ // Get the managedBuildRevsion of the extension.
+ for (int j = 0; j < elements.length; j++) {
+ IConfigurationElement element = elements[j];
+
+ if( element.getName().equals(REVISION_ELEMENT_NAME) ) {
+ revision = element.getAttribute(VERSION_ELEMENT_NAME);
+ break;
+ }
+ }
+
+ // Get the value of 'ManagedBuilRevision' attribute
+ loadConfigElements(DefaultManagedConfigElement.convertArray(elements), revision);
}
}
// Then call resolve.
@@ -1541,6 +1554,8 @@
extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID_V2);
if( extensionPoint != null) {
IExtension[] extensions = extensionPoint.getExtensions();
+ String revision = null;
+
if (extensions != null) {
if (extensions.length > 0) {
@@ -1554,8 +1569,20 @@
//The version of the Plug-in is greater than what the manager thinks it understands
throw new BuildException(ManagedMakeMessages.getResourceString(MANIFEST_VERSION_ERROR));
}
- IConfigurationElement[] elements = extension.getConfigurationElements();
- loadConfigElementsV2(DefaultManagedConfigElement.convertArray(elements));
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+
+ // Get the managedBuildRevsion of the extension.
+ for (int j = 0; j < elements.length; j++) {
+ IConfigurationElement element = elements[j];
+ if(element.getName().equals(REVISION_ELEMENT_NAME)) {
+ revision = element.getAttribute(VERSION_ELEMENT_NAME);
+ break;
+ }
+ }
+ // If the "fileVersion" attribute is missing, then default revision is "1.2.0"
+ if (revision == null)
+ revision = "1.2.0"; //$NON-NLS-1$
+ loadConfigElementsV2(DefaultManagedConfigElement.convertArray(elements), revision);
}
// Resolve references
Iterator targetIter = getExtensionTargetMap().values().iterator();
@@ -1586,7 +1613,7 @@
Target target = (Target)targetIter.next();
// Check to see if it has already been converted - if not, do it
if (target.getCreatedProjectType() == null) {
- target.convertToProjectType();
+ target.convertToProjectType(revision);
}
} catch (Exception ex) {
// TODO: log
@@ -1625,23 +1652,23 @@
}
}
- private static void loadConfigElements(IManagedConfigElement[] elements) {
+ private static void loadConfigElements(IManagedConfigElement[] elements, String revision) {
for (int toolIndex = 0; toolIndex < elements.length; ++toolIndex) {
try {
IManagedConfigElement element = elements[toolIndex];
// Load the top level elements, which in turn load their children
if (element.getName().equals(IProjectType.PROJECTTYPE_ELEMENT_NAME)) {
- new ProjectType(element);
+ new ProjectType(element, revision);
} else if (element.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
- new Configuration((ProjectType)null, element);
+ new Configuration((ProjectType)null, element, revision);
} else if (element.getName().equals(IToolChain.TOOL_CHAIN_ELEMENT_NAME)) {
- new ToolChain((Configuration)null, element);
+ new ToolChain((Configuration)null, element, revision);
} else if (element.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
- new Tool((ProjectType)null, element);
+ new Tool((ProjectType)null, element, revision);
} else if (element.getName().equals(ITargetPlatform.TARGET_PLATFORM_ELEMENT_NAME)) {
- new TargetPlatform((ToolChain)null, element);
+ new TargetPlatform((ToolChain)null, element, revision);
} else if (element.getName().equals(IBuilder.BUILDER_ELEMENT_NAME)) {
- new Builder((ToolChain)null, element);
+ new Builder((ToolChain)null, element, revision);
} else if (element.getName().equals(IManagedConfigElementProvider.ELEMENT_NAME)) {
// don't allow nested config providers.
if (element instanceof DefaultManagedConfigElement) {
@@ -1649,7 +1676,7 @@
IManagedConfigElementProvider provider = createConfigProvider(
(DefaultManagedConfigElement)element);
providedConfigs = provider.getConfigElements();
- loadConfigElements(providedConfigs); // This must use the current build model
+ loadConfigElements(providedConfigs, revision); // This must use the current build model
}
} else {
// TODO: Report an error (log?)
@@ -1661,15 +1688,15 @@
}
}
- private static void loadConfigElementsV2(IManagedConfigElement[] elements) {
+ private static void loadConfigElementsV2(IManagedConfigElement[] elements, String revision) {
for (int toolIndex = 0; toolIndex < elements.length; ++toolIndex) {
try {
IManagedConfigElement element = elements[toolIndex];
// Load the top level elements, which in turn load their children
if (element.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
- new Tool(element);
+ new Tool(element, revision);
} else if (element.getName().equals(ITarget.TARGET_ELEMENT_NAME)) {
- new Target(element);
+ new Target(element,revision);
} else if (element.getName().equals(IManagedConfigElementProvider.ELEMENT_NAME)) {
// don't allow nested config providers.
if (element instanceof DefaultManagedConfigElement) {
@@ -1677,7 +1704,7 @@
IManagedConfigElementProvider provider = createConfigProvider(
(DefaultManagedConfigElement)element);
providedConfigs = provider.getConfigElements();
- loadConfigElementsV2(providedConfigs); // This must use the 2.0 build model
+ loadConfigElementsV2(providedConfigs, revision); // This must use the 2.0 build model
}
}
} catch (Exception ex) {
@@ -2050,6 +2077,54 @@
public static IEnvironmentVariableProvider getEnvironmentVariableProvider(){
return EnvironmentVariableProvider.getDefault();
}
+
+ /**
+ * Returns the version, if 'id' contains a valid version
+ * Returns null if 'id' does not contain a valid version
+ * Returns null if 'id' does not contain a version
+ *
+ * @param idAndVersion
+ * @return String
+ */
+
+ public static String getVersionFromIdAndVersion(String idAndVersion) {
+
+// Get the index of the separator '_' in tool id.
+ int index = idAndVersion.lastIndexOf('_');
+
+ //Validate the version number if exists.
+ if ( index != -1) {
+ // Get the version number from tool id.
+ String version = idAndVersion.substring(index+1);
+ IStatus status = PluginVersionIdentifier.validateVersion(version);
+
+ // If there is a valid version then return 'version'
+ if ( status.isOK())
+ return version;
+ }
+ // If there is no version information or not a valid version, return null
+ return null;
+ }
+
+ /**
+ * If the input to this function contains 'id & a valid version', it returns only the 'id' part
+ * Otherwise it returns the received input back.
+ *
+ * @param idAndVersion
+ * @return String
+ */
+ public static String getIdFromIdAndVersion(String idAndVersion) {
+ // If there is a valid version return only 'id' part
+ if ( getVersionFromIdAndVersion(idAndVersion) != null) {
+ // Get the index of the separator '_' in tool id.
+ int index = idAndVersion.lastIndexOf('_');
+ return idAndVersion.substring(0,index);
+ }
+ else {
+ // if there is no version or no valid version
+ return idAndVersion;
+ }
+ }
/**
* Returns the instance of the Build Macro Provider
@@ -2059,5 +2134,4 @@
public static IBuildMacroProvider getBuildMacroProvider(){
return BuildMacroProvider.getDefault();
}
-
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java,v
retrieving revision 1.3
diff -u -r1.3 BuildObject.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java 24 Jun 2004 15:56:06 -0000 1.3
+++ src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java 25 May 2005 18:20:35 -0000
@@ -12,12 +12,18 @@
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
public class BuildObject implements IBuildObject {
protected String id;
protected String name;
+ protected PluginVersionIdentifier version = null;
+ protected String managedBuildRevision = null;
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
*/
@@ -52,4 +58,57 @@
public String toString() {
return name;
}
+
+ /**
+ * @return Returns the managedBuildRevision.
+ */
+ public String getManagedBuildRevision() {
+ return managedBuildRevision;
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ return version;
+ }
+
+ /**
+ * @param version The version to set.
+ */
+ public void setVersion(PluginVersionIdentifier version) {
+ this.version = version;
+ }
+
+ public PluginVersionIdentifier getVersionFromId() {
+ String versionNumber;
+ IStatus status = null;
+
+
+ versionNumber = ManagedBuildManager.getVersionFromIdAndVersion( getId());
+
+ if( versionNumber == null) {
+ // It means, Tool Integrator either not provided version information in 'id' or provided in wrong format,
+ // So get the default version based on 'managedBuildRevision' attribute.
+
+ if ( getManagedBuildRevision() != null) {
+ PluginVersionIdentifier tmpManagedBuildRevision = new PluginVersionIdentifier( getManagedBuildRevision() );
+ if (tmpManagedBuildRevision.isEquivalentTo(new PluginVersionIdentifier("1.2.0")) ) //$NON-NLS-1$
+ versionNumber = "0.0.1"; //$NON-NLS-1$
+ else if (tmpManagedBuildRevision.isEquivalentTo(new PluginVersionIdentifier("2.0.0")) ) //$NON-NLS-1$
+ versionNumber = "0.0.2"; //$NON-NLS-1$
+ else if (tmpManagedBuildRevision.isEquivalentTo(new PluginVersionIdentifier("2.1.0")) ) //$NON-NLS-1$
+ versionNumber = "0.0.3"; //$NON-NLS-1$
+ else
+ versionNumber = "0.0.4"; //$NON-NLS-1$
+ } else {
+ versionNumber = "0.0.0";
+ }
+ }
+ return new PluginVersionIdentifier(versionNumber);
+ }
+
+ public void setManagedBuildRevision(String managedBuildRevision) {
+ this.managedBuildRevision = managedBuildRevision;
+ }
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java,v
retrieving revision 1.6
diff -u -r1.6 Builder.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java 19 May 2005 16:19:09 -0000 1.6
+++ src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java 25 May 2005 18:20:35 -0000
@@ -66,18 +66,22 @@
* This constructor is called to create a builder defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
*
- * @param parent The IToolChain parent of this builder, or <code>null</code> if
- * defined at the top level
- * @param element The builder definition from the manifest file or a dynamic element
- * provider
+ * @param parent The IToolChain parent of this builder, or <code>null</code> if
+ * defined at the top level
+ * @param element The builder definition from the manifest file or a dynamic element
+ * provider
+ * @param managedBuildRevision The fileVersion of Managed Buid System
*/
- public Builder(IToolChain parent, IManagedConfigElement element) {
+ public Builder(IToolChain parent, IManagedConfigElement element, String managedBuildRevision) {
this.parent = parent;
isExtensionBuilder = true;
// setup for resolving
resolved = false;
+ // Set the managedBuildRevision
+ setManagedBuildRevision(managedBuildRevision);
+
loadFromManifest(element);
// Hook me up to the Managed Build Manager
@@ -97,11 +101,14 @@
public Builder(ToolChain parent, IBuilder superClass, String Id, String name, boolean isExtensionElement) {
this.parent = parent;
this.superClass = superClass;
+ setManagedBuildRevision(parent.getManagedBuildRevision());
if (this.superClass != null) {
superClassId = this.superClass.getId();
}
setId(Id);
setName(name);
+ setVersion(getVersionFromId());
+
isExtensionBuilder = isExtensionElement;
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
@@ -117,11 +124,15 @@
*
* @param parent The <code>IToolChain</code> the Builder will be added to.
* @param element The XML element that contains the Builder settings.
+ * @param managedBuildRevision The fileVersion of Managed Buid System
*/
- public Builder(IToolChain parent, Element element) {
+ public Builder(IToolChain parent, Element element, String managedBuildRevision) {
this.parent = parent;
isExtensionBuilder = false;
+ // Set the managedBuildRevision
+ setManagedBuildRevision(managedBuildRevision);
+
// Initialize from the XML attributes
loadFromProject(element);
}
@@ -142,9 +153,20 @@
}
setId(Id);
setName(name);
+
+ // Set the managedBuildRevision & the version
+ setManagedBuildRevision(builder.getManagedBuildRevision());
+ setVersion(getVersionFromId());
+
isExtensionBuilder = false;
// Copy the remaining attributes
+ if(builder.versionsSupported != null) {
+ versionsSupported = new String(builder.versionsSupported);
+ }
+ if(builder.convertToId != null) {
+ convertToId = new String(builder.convertToId);
+ }
if (builder.unusedChildren != null) {
unusedChildren = new String(builder.unusedChildren);
}
@@ -200,6 +222,9 @@
// Get the name
setName(element.getAttribute(IBuildObject.NAME));
+ // Set the version after extracting from 'id' attribute
+ setVersion(getVersionFromId());
+
// superClass
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
@@ -273,6 +298,9 @@
setName(element.getAttribute(IBuildObject.NAME));
}
+ // Set the version after extracting from 'id' attribute
+ setVersion(getVersionFromId());
+
// superClass
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
if (superClassId != null && superClassId.length() > 0) {
@@ -720,5 +748,4 @@
return superClass.getReservedMacroNameSupplier();
return reservedMacroNameSupplier;
}
-
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java,v
retrieving revision 1.29
diff -u -r1.29 Configuration.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java 20 May 2005 18:30:22 -0000 1.29
+++ src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java 25 May 2005 18:20:36 -0000
@@ -42,6 +42,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -84,14 +85,17 @@
*
* @param projectType The <code>ProjectType</code> the configuration will be added to.
* @param element The element from the manifest that contains the configuration information.
+ * @param managedBuildRevision
*/
- public Configuration(ProjectType projectType, IManagedConfigElement element) {
+ public Configuration(ProjectType projectType, IManagedConfigElement element, String managedBuildRevision) {
this.projectType = projectType;
isExtensionConfig = true;
// setup for resolving
resolved = false;
+ setManagedBuildRevision(managedBuildRevision);
+
// Initialize from the XML attributes
loadFromManifest(element);
@@ -108,9 +112,9 @@
for (int l = 0; l < configElements.length; ++l) {
IManagedConfigElement configElement = configElements[l];
if (configElement.getName().equals(IToolChain.TOOL_CHAIN_ELEMENT_NAME)) {
- toolChain = new ToolChain(this, configElement);
+ toolChain = new ToolChain(this, configElement, managedBuildRevision);
}else if (configElement.getName().equals(IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME)) {
- ResourceConfiguration resConfig = new ResourceConfiguration(this, configElement);
+ ResourceConfiguration resConfig = new ResourceConfiguration(this, configElement, managedBuildRevision);
addResourceConfiguration(resConfig);
}
}
@@ -145,7 +149,9 @@
// Hook me up to the ProjectType
if (projectType != null) {
- projectType.addConfiguration(this);
+ projectType.addConfiguration(this);
+ // set managedBuildRevision
+ setManagedBuildRevision(projectType.getManagedBuildRevision());
}
}
@@ -170,6 +176,7 @@
// Hook me up to the ProjectType
if (projectType != null) {
projectType.addConfiguration(this);
+ setManagedBuildRevision(projectType.getManagedBuildRevision());
}
}
@@ -179,11 +186,14 @@
*
* @param managedProject The <code>ManagedProject</code> the configuration will be added to.
* @param element The XML element that contains the configuration settings.
+ *
*/
- public Configuration(ManagedProject managedProject, Element element) {
+ public Configuration(ManagedProject managedProject, Element element, String managedBuildRevision) {
this.managedProject = managedProject;
isExtensionConfig = false;
+ setManagedBuildRevision(managedBuildRevision);
+
// Initialize from the XML attributes
loadFromProject(element);
@@ -194,9 +204,9 @@
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
if (configElement.getNodeName().equals(IToolChain.TOOL_CHAIN_ELEMENT_NAME)) {
- toolChain = new ToolChain(this, (Element)configElement);
+ toolChain = new ToolChain(this, (Element)configElement, managedBuildRevision);
}else if (configElement.getNodeName().equals(IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME)) {
- ResourceConfiguration resConfig = new ResourceConfiguration(this, (Element)configElement);
+ ResourceConfiguration resConfig = new ResourceConfiguration(this, (Element)configElement, managedBuildRevision);
addResourceConfiguration(resConfig);
}
}
@@ -216,10 +226,13 @@
this.managedProject = managedProject;
isExtensionConfig = false;
+ // set managedBuildRevision
+ setManagedBuildRevision(cloneConfig.getManagedBuildRevision());
+
// If this contructor is called to clone an existing
// configuration, the parent of the cloning config should be stored.
parent = cloneConfig.getParent() == null ? cloneConfig : cloneConfig.getParent();
-
+
// Copy the remaining attributes
projectType = cloneConfig.projectType;
if (cloneConfig.artifactName != null) {
@@ -251,22 +264,37 @@
// Tool Chain
int nnn = ManagedBuildManager.getRandomNumber();
String subId;
+ String tmpId;
String subName;
if (cloneConfig.parent != null) {
- subId = cloneConfig.parent.getToolChain().getId() + "." + nnn; //$NON-NLS-1$
- subName = cloneConfig.parent.getToolChain().getName(); //$NON-NLS-1$
+ tmpId = cloneConfig.parent.getToolChain().getId();
+ subName = cloneConfig.parent.getToolChain().getName();
+
} else {
- subId = cloneConfig.getToolChain().getId() + "." + nnn; //$NON-NLS-1$
- subName = cloneConfig.getToolChain().getName(); //$NON-NLS-1$
+ tmpId = cloneConfig.getToolChain().getId();
+ subName = cloneConfig.getToolChain().getName();
}
-
+
+ String version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ if ( version != null) { // If the 'tmpId' contains version information
+ subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ subId = tmpId + "." + nnn; //$NON-NLS-1$
+ }
+
if (cloneTools) {
toolChain = new ToolChain(this, subId, subName, (ToolChain)cloneConfig.getToolChain());
} else {
// Add a tool-chain element that specifies as its superClass the
// tool-chain that is the child of the configuration.
ToolChain superChain = (ToolChain)cloneConfig.getToolChain();
- subId = superChain.getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = superChain.getId();
+ version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ if ( version != null) { // If the 'tmpId' contains version information
+ subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ subId = tmpId + "." + nnn; //$NON-NLS-1$
+ }
IToolChain newChain = createToolChain(superChain, subId, superChain.getName(), false);
// For each tool element child of the tool-chain that is the child of
@@ -277,7 +305,13 @@
while (iter.hasNext()) {
Tool toolChild = (Tool) iter.next();
nnn = ManagedBuildManager.getRandomNumber();
- subId = toolChild.getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = toolChild.getId();
+ version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ if ( version != null) { // If the 'tmpId' contains version information
+ subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ subId = tmpId + "." + nnn; //$NON-NLS-1$
+ }
newChain.createTool(toolChild, subId, toolChild.getName(), false);
}
}
@@ -1356,6 +1390,24 @@
return toolChain.getEnvironmentVariableSupplier();
return null;
}
+
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( projectType != null) {
+ projectType.getVersion();
+ } else if ( managedProject != null) {
+ return managedProject.getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildMacroSupplier()
Index: src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java,v
retrieving revision 1.3
diff -u -r1.3 InputType.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java 23 May 2005 20:30:12 -0000 1.3
+++ src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java 25 May 2005 18:20:37 -0000
@@ -31,6 +31,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -122,6 +123,7 @@
}
setId(Id);
setName(name);
+
isExtensionInputType = isExtensionElement;
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
@@ -137,6 +139,7 @@
*
* @param parent The <code>ITool</code> the InputType will be added to.
* @param element The XML element that contains the InputType settings.
+ *
*/
public InputType(ITool parent, Element element) {
this.parent = parent;
@@ -177,6 +180,7 @@
}
setId(Id);
setName(name);
+
isExtensionInputType = false;
// Copy the remaining attributes
@@ -1094,4 +1098,31 @@
}
}
+ /**
+ * @return Returns the managedBuildRevision.
+ */
+ public String getManagedBuildRevision() {
+ if ( managedBuildRevision == null) {
+ if ( getParent() != null) {
+ return getParent().getManagedBuildRevision();
+ }
+ }
+ return managedBuildRevision;
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( getParent() != null) {
+ return getParent().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java,v
retrieving revision 1.38
diff -u -r1.38 ManagedBuildInfo.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java 19 May 2005 16:19:09 -0000 1.38
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java 25 May 2005 18:20:37 -0000
@@ -120,15 +120,16 @@
*
* @param owner
* @param element
+ * @param managedBuildRevision
*/
- public ManagedBuildInfo(IResource owner, Element element) {
+ public ManagedBuildInfo(IResource owner, Element element, String managedBuildRevision) {
this(owner);
// Recreate the managed build project element and its children
NodeList projNodes = element.getElementsByTagName(IManagedProject.MANAGED_PROJECT_ELEMENT_NAME);
// TODO: There should only be 1?
for (int projIndex = projNodes.getLength() - 1; projIndex >= 0; --projIndex) {
- ManagedProject proj = new ManagedProject(this, (Element)projNodes.item(projIndex));
+ ManagedProject proj = new ManagedProject(this, (Element)projNodes.item(projIndex), managedBuildRevision);
if (!proj.resolveReferences())
proj.setValid(false);
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java,v
retrieving revision 1.4
diff -u -r1.4 ManagedProject.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java 19 May 2005 16:19:09 -0000 1.4
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java 25 May 2005 18:20:38 -0000
@@ -30,6 +30,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -83,6 +84,8 @@
setId(owner.getName() + "." + projectType.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
setName(projectType.getName());
+ setManagedBuildRevision(projectType.getManagedBuildRevision());
+
// Hook me up
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
buildInfo.setManagedProject(this);
@@ -94,10 +97,13 @@
*
* @param buildInfo
* @param element
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public ManagedProject(ManagedBuildInfo buildInfo, Element element) {
+ public ManagedProject(ManagedBuildInfo buildInfo, Element element, String managedBuildRevision) {
this(buildInfo.getOwner());
+ setManagedBuildRevision(managedBuildRevision);
+
// Initialize from the XML attributes
if (loadFromProject(element)) {
// Load children
@@ -105,7 +111,7 @@
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
if (configElement.getNodeName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
- Configuration config = new Configuration(this, (Element)configElement);
+ Configuration config = new Configuration(this, (Element)configElement, managedBuildRevision);
}else if (configElement.getNodeName().equals(StorableMacros.MACROS_ELEMENT_NAME)) {
//load user-defined macros
userDefinedMacros = new StorableMacros((Element)configElement);
@@ -440,6 +446,22 @@
this.isValid = isValid;
}
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if (version == null) {
+ if ( getProjectType() != null) {
+ return getProjectType().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
+
/*
* this method is called by the UserDefinedMacroSupplier to obtain user-defined
* macros available for this managed project
Index: src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java,v
retrieving revision 1.16
diff -u -r1.16 Option.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/Option.java 21 Apr 2005 02:05:04 -0000 1.16
+++ src/org/eclipse/cdt/managedbuilder/internal/core/Option.java 25 May 2005 18:20:38 -0000
@@ -27,6 +27,7 @@
import org.eclipse.cdt.managedbuilder.core.IProjectType;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -1062,11 +1063,11 @@
/*
* In order to determine the current value of an option, perform the following steps until a value is found:
* 1. Examine the value attribute of the option.
- * 2. Examine the value attribute of the option�s superClass recursively.
+ * 2. Examine the value attribute of the option�s superClass recursively.
* 3. Examine the dynamicDefaultValue attribute of the option and invoke it if specified. (not yet implemented)
* 4. Examine the defaultValue attribute of the option.
- * 5. Examine the dynamicDefaultValue attribute of the option�s superClass and invoke it if specified. (not yet implemented)
- * 6. Examine the defaultValue attribute of the option�s superClass.
+ * 5. Examine the dynamicDefaultValue attribute of the option�s superClass and invoke it if specified. (not yet implemented)
+ * 6. Examine the defaultValue attribute of the option�s superClass.
* 7. Go to step 5 recursively until no more super classes.
* 8. Use the default value for the option type.
*/
@@ -1421,4 +1422,31 @@
}
}
+ /**
+ * @return Returns the managedBuildRevision.
+ */
+ public String getManagedBuildRevision() {
+ if ( managedBuildRevision == null) {
+ if ( getParent() != null) {
+ return getParent().getManagedBuildRevision();
+ }
+ }
+ return managedBuildRevision;
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( getParent() != null) {
+ return getParent().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java,v
retrieving revision 1.8
diff -u -r1.8 OptionCategory.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java 22 Nov 2004 21:50:46 -0000 1.8
+++ src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java 25 May 2005 18:20:38 -0000
@@ -21,6 +21,7 @@
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+// import org.eclipse.core.runtime.PluginVersionIdentifier; // uncomment this line after 'parent' is available
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -317,4 +318,34 @@
}
}
+ // Uncomment this code after the 'parent' is available
+ /**
+ * @return Returns the managedBuildRevision.
+ *
+ public String getManagedBuildRevision() {
+ if ( managedBuildRevision == null) {
+ if ( getParent() != null) {
+ return getParent().getManagedBuildRevision();
+ }
+ }
+ return managedBuildRevision;
+ }
+
+ /**
+ * @return Returns the version.
+ *
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( getParent() != null) {
+ return getParent().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
+*/
+
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java,v
retrieving revision 1.17
diff -u -r1.17 OptionReference.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java 28 Oct 2004 17:16:53 -0000 1.17
+++ src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java 25 May 2005 18:20:38 -0000
@@ -21,6 +21,7 @@
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -720,5 +721,19 @@
*/
public void setCommandFalse(String cmd) {
}
-
+
+ public PluginVersionIdentifier getVersion() {
+ // TODO Auto-generated method stub
+ return option.getVersion();
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // TODO Auto-generated method stub
+ option.setVersion(version);
+ }
+
+ public String getManagedBuildRevision() {
+ // TODO Auto-generated method stub
+ return option.getManagedBuildRevision();
+ }
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java,v
retrieving revision 1.3
diff -u -r1.3 OutputType.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java 12 May 2005 19:07:32 -0000 1.3
+++ src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java 25 May 2005 18:20:38 -0000
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -826,4 +827,31 @@
}
}
+ /**
+ * @return Returns the managedBuildRevision.
+ */
+ public String getManagedBuildRevision() {
+ if ( managedBuildRevision == null) {
+ if ( getParent() != null) {
+ return getParent().getManagedBuildRevision();
+ }
+ }
+ return managedBuildRevision;
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( getParent() != null) {
+ return getParent().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java,v
retrieving revision 1.6
diff -u -r1.6 ProjectType.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java 19 May 2005 16:19:09 -0000 1.6
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java 25 May 2005 18:20:39 -0000
@@ -26,6 +26,8 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.cdt.managedbuilder.envvar.IProjectEnvironmentVariableSupplier;
+
public class ProjectType extends BuildObject implements IProjectType {
private static final String EMPTY_STRING = new String();
@@ -52,7 +54,7 @@
// Miscellaneous
private boolean resolved = true;
-
+
/*
* C O N S T R U C T O R S
*/
@@ -62,11 +64,14 @@
* a plugin manifest file.
*
* @param element
+ * @param managedBuildRevision
*/
- public ProjectType(IManagedConfigElement element) {
+ public ProjectType(IManagedConfigElement element, String managedBuildRevision) {
// setup for resolving
resolved = false;
+ setManagedBuildRevision(managedBuildRevision);
+
loadFromManifest(element);
// Hook me up to the Managed Build Manager
@@ -82,14 +87,14 @@
// Tool Integrator provided 'ConfigurationNameProvider' class
// to get configuration names dynamically based architecture, os, toolchain version etc.
for (int n = 0; n < configs.length; ++n) {
- Configuration config = new Configuration(this, configs[n]);
+ Configuration config = new Configuration(this, configs[n], managedBuildRevision);
String newConfigName = configurationNameProvder.getNewConfigurationName(config, usedConfigNames);
config.setName(newConfigName);
usedConfigNames[n] = newConfigName;
}
} else {
for (int n = 0; n < configs.length; ++n) {
- Configuration config = new Configuration(this, configs[n]);
+ Configuration config = new Configuration(this, configs[n], managedBuildRevision);
}
}
}
@@ -102,7 +107,7 @@
* @param String The id for the new project type
* @param String The name for the new project type
*/
- public ProjectType(ProjectType superClass, String Id, String name) {
+ public ProjectType(ProjectType superClass, String Id, String name, String managedBuildRevision) {
// setup for resolving
resolved = false;
@@ -112,6 +117,10 @@
}
setId(Id);
setName(name);
+
+ setManagedBuildRevision(managedBuildRevision);
+ setVersion(getVersionFromId());
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionProjectType(this);
}
@@ -134,6 +143,9 @@
// Get the name
setName(element.getAttribute(NAME));
+ // version
+ setVersion(getVersionFromId());
+
// superClass
superClassId = element.getAttribute(SUPERCLASS);
@@ -473,7 +485,7 @@
}
return null;
}
-
+
/**
* Returns the plugin.xml element of the projectMacroSupplier extension or <code>null</code> if none.
*
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java,v
retrieving revision 1.2
diff -u -r1.2 ResourceConfiguration.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java 29 Nov 2004 15:04:05 -0000 1.2
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java 25 May 2005 18:20:39 -0000
@@ -26,6 +26,7 @@
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -58,14 +59,16 @@
* @param parent The IConfiguration parent of this resource configuration
* @param element The resource configuration definition from the manifest file
* or a dynamic element provider
+ * @param managedBuildRevision
*/
- public ResourceConfiguration(IConfiguration parent, IManagedConfigElement element) {
+ public ResourceConfiguration(IConfiguration parent, IManagedConfigElement element, String managedBuildRevision) {
this.parent = parent;
isExtensionResourceConfig = true;
// setup for resolving
resolved = false;
+ setManagedBuildRevision(managedBuildRevision);
loadFromManifest(element);
// Hook me up to the Managed Build Manager
@@ -74,7 +77,7 @@
// Load the tool children
IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
for (int n = 0; n < tools.length; ++n) {
- Tool toolChild = new Tool(this, tools[n]);
+ Tool toolChild = new Tool(this, tools[n], getManagedBuildRevision());
toolList.add(toolChild);
}
}
@@ -85,11 +88,13 @@
*
* @param parent The <code>IConfiguration</code> the resource configuration will be added to.
* @param element The XML element that contains the resource configuration settings.
+ * @param managedBuildRevision
*/
- public ResourceConfiguration(IConfiguration parent, Element element) {
+ public ResourceConfiguration(IConfiguration parent, Element element, String managedBuildRevision) {
this.parent = parent;
isExtensionResourceConfig = false;
+ setManagedBuildRevision(managedBuildRevision);
// Initialize from the XML attributes
loadFromProject(element);
@@ -98,7 +103,7 @@
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
if (configElement.getNodeName().equals(ITool.TOOL_ELEMENT_NAME)) {
- Tool tool = new Tool((IBuildObject)this, (Element)configElement);
+ Tool tool = new Tool((IBuildObject)this, (Element)configElement, getManagedBuildRevision());
addTool(tool);
}
}
@@ -110,6 +115,9 @@
setId(id);
setName(resourceName);
+ if ( parent != null)
+ setManagedBuildRevision(parent.getManagedBuildRevision());
+
resPath = path;
isDirty = false;
isExcluded = new Boolean(false);
@@ -128,6 +136,8 @@
this.parent = parent;
isExtensionResourceConfig = false;
+ setManagedBuildRevision(cloneConfig.getManagedBuildRevision());
+
// Copy the remaining attributes
if (cloneConfig.resPath != null) {
resPath = new String(cloneConfig.resPath);
@@ -143,14 +153,24 @@
Tool toolChild = (Tool) iter.next();
int nnn = ManagedBuildManager.getRandomNumber();
String subId;
+ String tmpId;
String subName;
+ String version;
+
if (toolChild.getSuperClass() != null) {
- subId = toolChild.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = toolChild.getSuperClass().getId();
subName = toolChild.getSuperClass().getName();
} else {
- subId = toolChild.getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = toolChild.getId();
subName = toolChild.getName();
+ }
+ version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ if ( version != null) { // If the 'tmpId' contains version information
+ subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ subId = tmpId + "." + nnn; //$NON-NLS-1$
}
+
// The superclass for the cloned tool is not the same as the one from the tool being cloned.
// The superclasses reside in different configurations.
ITool toolSuperClass = null;
@@ -620,4 +640,22 @@
public IResource getOwner() {
return getParent().getOwner();
}
+
+
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( getParent() != null) {
+ return getParent().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
+
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java,v
retrieving revision 1.32
diff -u -r1.32 Target.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/Target.java 21 Apr 2005 02:05:04 -0000 1.32
+++ src/org/eclipse/cdt/managedbuilder/internal/core/Target.java 25 May 2005 18:20:39 -0000
@@ -34,6 +34,7 @@
import org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedBuildCPathEntryContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -70,8 +71,9 @@
* a plugin manifest file.
*
* @param element
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public Target(IManagedConfigElement element) {
+ public Target(IManagedConfigElement element, String managedBuildRevision) {
// setup for resolving
ManagedBuildManager.putConfigElement(this, element);
resolved = false;
@@ -79,6 +81,9 @@
// id
setId(element.getAttribute(ID));
+ // managedBuildRevision
+ setManagedBuildRevision(managedBuildRevision);
+
// hook me up
ManagedBuildManager.addExtensionTarget(this);
@@ -133,7 +138,7 @@
}
}
- // Load any tool references we might have
+ // Load any tool references we might have
IManagedConfigElement[] toolRefs = element.getChildren(IConfigurationV2.TOOLREF_ELEMENT_NAME);
for (int k = 0; k < toolRefs.length; ++k) {
new ToolReference(this, toolRefs[k]);
@@ -141,7 +146,7 @@
// Then load any tools defined for the target
IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
for (int m = 0; m < tools.length; ++m) {
- ITool newTool = new Tool(this, tools[m]);
+ ITool newTool = new Tool(this, tools[m], managedBuildRevision);
// Add this tool to the target, as this is not done in the constructor
this.addTool(newTool);
}
@@ -177,6 +182,9 @@
int id = ManagedBuildManager.getRandomNumber();
setId(owner.getName() + "." + parent.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
setName(parent.getName());
+
+ setManagedBuildRevision(parent.getManagedBuildRevision());
+
setArtifactName(parent.getArtifactName());
this.binaryParserId = parent.getBinaryParserId();
this.errorParserIds = parent.getErrorParserIds();
@@ -959,7 +967,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#convertToProjectType()
*/
- public void convertToProjectType() {
+ public void convertToProjectType(String managedBuildRevision) {
// Create a ProjectType + Configuration + Toolchain + Builder + TargetPlatform
// from the Target
@@ -969,11 +977,11 @@
if (parent != null) {
parentProj = parent.getCreatedProjectType();
if (parentProj == null) {
- parent.convertToProjectType();
+ parent.convertToProjectType(managedBuildRevision);
parentProj = parent.getCreatedProjectType();
}
}
- ProjectType projectType = new ProjectType(parentProj, getId(), getName());
+ ProjectType projectType = new ProjectType(parentProj, getId(), getName(), managedBuildRevision);
createdProjectType = projectType;
// Set the project type attributes
projectType.setIsAbstract(isAbstract);
@@ -1146,4 +1154,20 @@
return createdProjectType;
}
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( getParent() != null) {
+ return getParent().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
+
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java,v
retrieving revision 1.4
diff -u -r1.4 TargetPlatform.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java 21 Apr 2005 02:05:04 -0000 1.4
+++ src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java 25 May 2005 18:20:39 -0000
@@ -20,6 +20,7 @@
import org.eclipse.cdt.managedbuilder.core.ITargetPlatform;
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -56,14 +57,16 @@
* defined at the top level
* @param element The TargetPlatform definition from the manifest file or a dynamic element
* provider
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public TargetPlatform(IToolChain parent, IManagedConfigElement element) {
+ public TargetPlatform(IToolChain parent, IManagedConfigElement element, String managedBuildRevision) {
this.parent = parent;
isExtensionTargetPlatform = true;
// setup for resolving
resolved = false;
-
+
+ setManagedBuildRevision(managedBuildRevision);
loadFromManifest(element);
// Hook me up to the Managed Build Manager
@@ -83,11 +86,13 @@
public TargetPlatform(ToolChain parent, ITargetPlatform superClass, String Id, String name, boolean isExtensionElement) {
this.parent = parent;
this.superClass = superClass;
+ setManagedBuildRevision(parent.getManagedBuildRevision());
if (this.superClass != null) {
superClassId = this.superClass.getId();
}
setId(Id);
setName(name);
+
isExtensionTargetPlatform = isExtensionElement;
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
@@ -103,11 +108,13 @@
*
* @param parent The <code>IToolChain</code> the TargetPlatform will be added to.
* @param element The XML element that contains the TargetPlatform settings.
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public TargetPlatform(IToolChain parent, Element element) {
+ public TargetPlatform(IToolChain parent, Element element, String managedBuildRevision) {
this.parent = parent;
isExtensionTargetPlatform = false;
+ setManagedBuildRevision(managedBuildRevision);
// Initialize from the XML attributes
loadFromProject(element);
}
@@ -129,6 +136,9 @@
setId(Id);
setName(name);
isExtensionTargetPlatform = false;
+
+ if ( targetPlatform != null)
+ setManagedBuildRevision(targetPlatform.getManagedBuildRevision());
// Copy the remaining attributes
if (targetPlatform.unusedChildren != null) {
@@ -582,4 +592,20 @@
}
}
+ /**
+ * @return Returns the version.
+ */
+ public PluginVersionIdentifier getVersion() {
+ if ( version == null) {
+ if ( getParent() != null) {
+ return getParent().getVersion();
+ }
+ }
+ return version;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // Do nothing
+ }
+
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java,v
retrieving revision 1.31
diff -u -r1.31 Tool.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java 20 May 2005 02:34:37 -0000 1.31
+++ src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java 25 May 2005 18:20:40 -0000
@@ -117,13 +117,17 @@
* manifest.
*
* @param element The element containing the information about the tool.
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public Tool(IManagedConfigElement element) {
+ public Tool(IManagedConfigElement element, String managedBuildRevision) {
isExtensionTool = true;
// setup for resolving
resolved = false;
+ // Set the managedBuildRevision
+ setManagedBuildRevision(managedBuildRevision);
+
loadFromManifest(element);
// hook me up
@@ -160,9 +164,10 @@
* @param parent The parent of this tool. This can be a ToolChain or a
* ResourceConfiguration.
* @param element The element containing the information about the tool.
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public Tool(IBuildObject parent, IManagedConfigElement element) {
- this(element);
+ public Tool(IBuildObject parent, IManagedConfigElement element, String managedBuildRevision) {
+ this(element, managedBuildRevision);
this.parent = parent;
}
@@ -179,11 +184,15 @@
public Tool(ToolChain parent, ITool superClass, String Id, String name, boolean isExtensionElement) {
this.parent = parent;
this.superClass = superClass;
+ setManagedBuildRevision(parent.getManagedBuildRevision());
if (this.superClass != null) {
superClassId = this.superClass.getId();
}
+
setId(Id);
setName(name);
+ setVersion(getVersionFromId());
+
isExtensionTool = isExtensionElement;
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
@@ -207,11 +216,14 @@
public Tool(ResourceConfiguration parent, ITool superClass, String Id, String name, boolean isExtensionElement) {
this.parent = parent;
this.superClass = superClass;
+ setManagedBuildRevision(parent.getManagedBuildRevision());
if (this.superClass != null) {
superClassId = this.superClass.getId();
}
setId(Id);
setName(name);
+ setVersion(getVersionFromId());
+
isExtensionTool = isExtensionElement;
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
@@ -228,11 +240,15 @@
* @param parent The <code>IToolChain</code> or <code>IResourceConfiguration</code>
* the tool will be added to.
* @param element The XML element that contains the tool settings.
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public Tool(IBuildObject parent, Element element) {
+ public Tool(IBuildObject parent, Element element, String managedBuildRevision) {
this.parent = parent;
isExtensionTool = false;
+ // Set the managedBuildRevsion
+ setManagedBuildRevision(managedBuildRevision);
+
// Initialize from the XML attributes
loadFromProject(element);
@@ -277,9 +293,20 @@
}
setId(Id);
setName(name);
+
+ // Set the managedBuildRevision & the version
+ setManagedBuildRevision(tool.getManagedBuildRevision());
+ setVersion(getVersionFromId());
+
isExtensionTool = false;
// Copy the remaining attributes
+ if(tool.versionsSupported != null) {
+ versionsSupported = new String(tool.versionsSupported);
+ }
+ if(tool.convertToId != null) {
+ convertToId = new String(tool.convertToId);
+ }
if (tool.unusedChildren != null) {
unusedChildren = new String(tool.unusedChildren);
}
@@ -407,6 +434,9 @@
// name
setName(element.getAttribute(ITool.NAME));
+
+ // version
+ setVersion(getVersionFromId());
// superClass
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
@@ -519,6 +549,9 @@
if (element.hasAttribute(IBuildObject.NAME)) {
setName(element.getAttribute(IBuildObject.NAME));
}
+
+ // version
+ setVersion(getVersionFromId());
// superClass
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
@@ -2549,5 +2582,4 @@
envVarBuildPathList.add(path);
}
-
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java,v
retrieving revision 1.10
diff -u -r1.10 ToolChain.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java 19 May 2005 16:19:09 -0000 1.10
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java 25 May 2005 18:20:40 -0000
@@ -88,14 +88,18 @@
* defined at the top level
* @param element The tool-chain definition from the manifest file or a dynamic element
* provider
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public ToolChain(IConfiguration parent, IManagedConfigElement element) {
+ public ToolChain(IConfiguration parent, IManagedConfigElement element, String managedBuildRevision) {
this.parent = parent;
isExtensionToolChain = true;
// setup for resolving
resolved = false;
+ // Set the managedBuildRevision
+ setManagedBuildRevision(managedBuildRevision);
+
loadFromManifest(element);
// Hook me up to the Managed Build Manager
@@ -108,7 +112,7 @@
// TODO: Report error
}
if (targetPlatforms.length > 0) {
- targetPlatform = new TargetPlatform(this, targetPlatforms[0]);
+ targetPlatform = new TargetPlatform(this, targetPlatforms[0], managedBuildRevision);
}
// Load the Builder child
@@ -118,13 +122,13 @@
// TODO: Report error
}
if (builders.length > 0) {
- builder = new Builder(this, builders[0]);
+ builder = new Builder(this, builders[0], managedBuildRevision);
}
// Load the tool children
IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
for (int n = 0; n < tools.length; ++n) {
- Tool toolChild = new Tool(this, tools[n]);
+ Tool toolChild = new Tool(this, tools[n], managedBuildRevision);
addTool(toolChild);
}
}
@@ -142,11 +146,15 @@
public ToolChain(Configuration parent, IToolChain superClass, String Id, String name, boolean isExtensionElement) {
this.parent = parent;
this.superClass = superClass;
+ setManagedBuildRevision(parent.getManagedBuildRevision());
+
if (this.superClass != null) {
superClassId = this.superClass.getId();
}
setId(Id);
setName(name);
+ setVersion(getVersionFromId());
+
isExtensionToolChain = isExtensionElement;
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
@@ -162,11 +170,15 @@
*
* @param parent The <code>IConfiguration</code> the tool-chain will be added to.
* @param element The XML element that contains the tool-chain settings.
+ * @param managedBuildRevision the fileVersion of Managed Build System
*/
- public ToolChain(IConfiguration parent, Element element) {
+ public ToolChain(IConfiguration parent, Element element, String managedBuildRevision) {
this.parent = parent;
isExtensionToolChain = false;
+ // Set the managedBuildRevision
+ setManagedBuildRevision(managedBuildRevision);
+
// Initialize from the XML attributes
loadFromProject(element);
@@ -175,21 +187,22 @@
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
if (configElement.getNodeName().equals(ITool.TOOL_ELEMENT_NAME)) {
- Tool tool = new Tool(this, (Element)configElement);
+ Tool tool = new Tool(this, (Element)configElement, managedBuildRevision);
addTool(tool);
}else if (configElement.getNodeName().equals(ITargetPlatform.TARGET_PLATFORM_ELEMENT_NAME)) {
if (targetPlatform != null) {
// TODO: report error
}
- targetPlatform = new TargetPlatform(this, (Element)configElement);
+ targetPlatform = new TargetPlatform(this, (Element)configElement, managedBuildRevision);
}else if (configElement.getNodeName().equals(IBuilder.BUILDER_ELEMENT_NAME)) {
if (builder != null) {
// TODO: report error
}
- builder = new Builder(this, (Element)configElement);
+ builder = new Builder(this, (Element)configElement, managedBuildRevision);
}else if (configElement.getNodeName().equals(StorableMacros.MACROS_ELEMENT_NAME)) {
//load user-defined macros
userDefinedMacros = new StorableMacros((Element)configElement);
+
}
}
}
@@ -210,9 +223,21 @@
}
setId(Id);
setName(name);
+
+ // Set the managedBuildRevision and the version
+ setManagedBuildRevision(toolChain.getManagedBuildRevision());
+ setVersion(getVersionFromId());
+
isExtensionToolChain = false;
// Copy the remaining attributes
+ if(toolChain.versionsSupported != null) {
+ versionsSupported = new String(toolChain.versionsSupported);
+ }
+ if(toolChain.convertToId != null) {
+ convertToId = new String(toolChain.convertToId);
+ }
+
if (toolChain.unusedChildren != null) {
unusedChildren = new String(toolChain.unusedChildren);
}
@@ -250,14 +275,24 @@
if (toolChain.builder != null) {
int nnn = ManagedBuildManager.getRandomNumber();
String subId;
+ String tmpId;
+ String version;
String subName;
+
if (toolChain.builder.getSuperClass() != null) {
- subId = toolChain.builder.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = toolChain.builder.getSuperClass().getId(); //$NON-NLS-1$
subName = toolChain.builder.getSuperClass().getName();
} else {
- subId = toolChain.builder.getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = toolChain.builder.getId(); //$NON-NLS-1$
subName = toolChain.builder.getName();
}
+ version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ if ( version != null) { // If the 'tmpId' contains version information
+ subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ subId = tmpId + "." + nnn; //$NON-NLS-1$
+ }
+
builder = new Builder(this, subId, subName, toolChain.builder);
}
if (toolChain.targetPlatform != null) {
@@ -279,14 +314,24 @@
Tool toolChild = (Tool) iter.next();
int nnn = ManagedBuildManager.getRandomNumber();
String subId;
+ String tmpId;
String subName;
+ String version;
+
if (toolChild.getSuperClass() != null) {
- subId = toolChild.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = toolChild.getSuperClass().getId();
subName = toolChild.getSuperClass().getName();
} else {
- subId = toolChild.getId() + "." + nnn; //$NON-NLS-1$
+ tmpId = toolChild.getId();
subName = toolChild.getName();
}
+ version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ if ( version != null) { // If the 'tmpId' contains version information
+ subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ subId = tmpId + "." + nnn; //$NON-NLS-1$
+ }
+
Tool newTool = new Tool(this, null, subId, subName, toolChild);
addTool(newTool);
}
@@ -314,6 +359,9 @@
// Get the name
setName(element.getAttribute(IBuildObject.NAME));
+ // version
+ setVersion(getVersionFromId());
+
// superClass
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
@@ -384,6 +432,7 @@
}
+
/* (non-Javadoc)
* Initialize the tool-chain information from the XML element
* specified in the argument
@@ -399,7 +448,10 @@
if (element.hasAttribute(IBuildObject.NAME)) {
setName(element.getAttribute(IBuildObject.NAME));
}
-
+
+ // version
+ setVersion(getVersionFromId());
+
// superClass
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
if (superClassId != null && superClassId.length() > 0) {
@@ -1367,6 +1419,4 @@
}
return null;
}
-
-
}
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java,v
retrieving revision 1.31
diff -u -r1.31 ToolReference.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java 19 May 2005 16:19:09 -0000 1.31
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java 25 May 2005 18:20:41 -0000
@@ -31,6 +31,7 @@
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -1174,4 +1175,16 @@
public IEnvVarBuildPath[] getEnvVarBuildPaths(){
return null;
}
+
+ public PluginVersionIdentifier getVersion() {
+ return null;
+ }
+
+ public void setVersion(PluginVersionIdentifier version) {
+ // TODO Auto-generated method stub
+ }
+
+ public String getManagedBuildRevision() {
+ return null;
+ }
}