Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/Element.java45
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/ReleaseManager.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/VersionBuilder.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/version/IElement.java4
5 files changed, 72 insertions, 16 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java b/plugins/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java
index 6592e20977..8b36491a16 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java
+++ b/plugins/org.eclipse.emf.cdo.releng.version.digest/src/org/eclipse/emf/cdo/releng/version/digest/DigestValidator.java
@@ -435,7 +435,7 @@ public class DigestValidator extends VersionValidator
continue;
}
- IModel componentModel = IReleaseManager.INSTANCE.getComponentModel(element);
+ IModel componentModel = IReleaseManager.INSTANCE.getComponentModel(element.trimVersion());
if (componentModel == null)
{
addWarning(warnings, name + ": Component not found");
diff --git a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/Element.java b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/Element.java
index a52cb599d7..df9c05cea6 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/Element.java
+++ b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/Element.java
@@ -37,6 +37,8 @@ public class Element implements IElement
private Version version;
+ private boolean licenseFeature;
+
private List<IElement> children = new ArrayList<IElement>();
private Set<IElement> allChildren;
@@ -54,6 +56,13 @@ public class Element implements IElement
this(type, name, new Version(version));
}
+ public Element(Type type, String name)
+ {
+ this.type = type;
+ this.name = name;
+ version = Version.emptyVersion;
+ }
+
public Type getType()
{
return type;
@@ -74,6 +83,16 @@ public class Element implements IElement
return version;
}
+ public boolean isLicenseFeature()
+ {
+ return licenseFeature;
+ }
+
+ public void setLicenseFeature(boolean licenseFeature)
+ {
+ this.licenseFeature = licenseFeature;
+ }
+
public List<IElement> getChildren()
{
return children;
@@ -108,7 +127,10 @@ public class Element implements IElement
for (IElement child : topElement.getChildren())
{
- recurseChildren(resolver, child);
+ if (!child.isLicenseFeature())
+ {
+ recurseChildren(resolver, child);
+ }
}
}
}
@@ -179,9 +201,22 @@ public class Element implements IElement
return false;
}
+ if (!version.equals(Version.emptyVersion) && !other.getVersion().equals(Version.emptyVersion))
+ {
+ if (!version.equals(other.getVersion()))
+ {
+ return false;
+ }
+ }
+
return true;
}
+ public IElement trimVersion()
+ {
+ return new Element(type, name);
+ }
+
public boolean isUnresolved()
{
return version.equals(Version.emptyVersion);
@@ -194,11 +229,11 @@ public class Element implements IElement
Version resolvedVersion;
if (type == Element.Type.PLUGIN)
{
- resolvedVersion = getPluginVersion(name);
+ resolvedVersion = getPluginVersion();
}
else
{
- resolvedVersion = getFeatureVersion(name);
+ resolvedVersion = getFeatureVersion();
}
if (resolvedVersion != null)
@@ -208,7 +243,7 @@ public class Element implements IElement
}
}
- private Version getPluginVersion(String name)
+ private Version getPluginVersion()
{
IPluginModelBase pluginModel = PluginRegistry.findModel(name);
if (pluginModel != null)
@@ -220,7 +255,7 @@ public class Element implements IElement
return null;
}
- private Version getFeatureVersion(String name)
+ private Version getFeatureVersion()
{
IModel componentModel = IReleaseManager.INSTANCE.getComponentModel(this);
if (componentModel != null)
diff --git a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/ReleaseManager.java b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/ReleaseManager.java
index e5043002ca..a5df9fdaa8 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/ReleaseManager.java
+++ b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/ReleaseManager.java
@@ -135,7 +135,7 @@ public class ReleaseManager implements IReleaseManager
{
if (!elements.containsKey(child))
{
- IModel childModel = getComponentModel(child);
+ IModel childModel = getComponentModel(child.trimVersion());
if (childModel != null)
{
IElement topElement = createElement(childModel, true);
@@ -189,7 +189,8 @@ public class ReleaseManager implements IReleaseManager
String licenseFeatureID = feature.getLicenseFeatureID();
if (licenseFeatureID.length() != 0)
{
- IElement child = new Element(IElement.Type.FEATURE, licenseFeatureID, feature.getLicenseFeatureVersion());
+ Element child = new Element(IElement.Type.FEATURE, licenseFeatureID, feature.getLicenseFeatureVersion());
+ child.setLicenseFeature(true);
element.getChildren().add(child);
}
@@ -215,7 +216,17 @@ public class ReleaseManager implements IReleaseManager
String name = element.getName();
if (element.getType() == IElement.Type.PLUGIN)
{
- return PluginRegistry.findModel(name);
+ IPluginModelBase model = PluginRegistry.findModel(name);
+ if (!element.isUnresolved())
+ {
+ Version pluginVersion = VersionUtil.normalize(model.getBundleDescription().getVersion());
+ if (!element.getVersion().equals(pluginVersion))
+ {
+ return null;
+ }
+ }
+
+ return model;
}
org.eclipse.pde.internal.core.FeatureModelManager manager = org.eclipse.pde.internal.core.PDECore.getDefault()
@@ -229,6 +240,16 @@ public class ReleaseManager implements IReleaseManager
featureModel = getFeatureModel(name, featureModels);
}
+ if (!element.isUnresolved())
+ {
+ org.eclipse.pde.internal.core.ifeature.IFeature feature = featureModel.getFeature();
+ Version featureVersion = VersionUtil.normalize(new Version(feature.getVersion()));
+ if (!element.getVersion().equals(featureVersion))
+ {
+ return null;
+ }
+ }
+
return featureModel;
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/VersionBuilder.java b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/VersionBuilder.java
index 388dc0573f..27ea50247d 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/VersionBuilder.java
+++ b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/internal/version/VersionBuilder.java
@@ -585,7 +585,7 @@ public class VersionBuilder extends IncrementalProjectBuilder implements IElemen
for (IElement releasedElementsChild : releasedElement.getAllChildren(release))
{
- if (!allChildren.contains(releasedElementsChild))
+ if (!allChildren.contains(releasedElementsChild.trimVersion()))
{
addWarning(releasedElementsChild, REMOVAL, warnings);
biggestChange = MAJOR_CHANGE; // REMOVAL
@@ -644,14 +644,14 @@ public class VersionBuilder extends IncrementalProjectBuilder implements IElemen
return NO_CHANGE;
}
- IElement releasedElementsChild = releasedElement.getChild(release, childElement);
+ IElement releasedElementsChild = releasedElement.getChild(release, childElement.trimVersion());
if (releasedElementsChild == null)
{
addWarning(childElement, ADDITION, warnings);
return MINOR_CHANGE; // ADDITION
}
- IElement childsReleasedElement = release.getElements().get(childElement);
+ IElement childsReleasedElement = release.getElements().get(childElement.trimVersion());
if (childsReleasedElement == null)
{
return NO_CHANGE;
@@ -659,10 +659,6 @@ public class VersionBuilder extends IncrementalProjectBuilder implements IElemen
Version releasedVersion = childsReleasedElement.getVersion();
Version version = childElement.getVersion();
- if (version == null)
- {
- return NO_CHANGE;
- }
if (version.getMajor() != releasedVersion.getMajor())
{
diff --git a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/version/IElement.java b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/version/IElement.java
index 8a09961da5..cfd37b4e28 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/version/IElement.java
+++ b/plugins/org.eclipse.emf.cdo.releng.version/src/org/eclipse/emf/cdo/releng/version/IElement.java
@@ -30,12 +30,16 @@ public interface IElement
public Version getVersion();
+ public boolean isLicenseFeature();
+
public List<IElement> getChildren();
public Set<IElement> getAllChildren(IElementResolver resolver);
public IElement getChild(IElementResolver resolver, IElement key);
+ public IElement trimVersion();
+
public boolean isUnresolved();
/**

Back to the top