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.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2013-11-23 16:38:41 +0000
committerEd Merks2013-11-23 16:38:41 +0000
commit3fdb0abc9717c127f3fc30023d18cb61a07143bd (patch)
tree18a56d18b484bc11aef5031cbd8d60808f484c0f /plugins
parent411a0cd1046303ae6d8663b711b1f4d945cc653f (diff)
downloadcdo-3fdb0abc9717c127f3fc30023d18cb61a07143bd.tar.gz
cdo-3fdb0abc9717c127f3fc30023d18cb61a07143bd.tar.xz
cdo-3fdb0abc9717c127f3fc30023d18cb61a07143bd.zip
Improve setup related models; support ranges for p2 and materialization
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/META-INF/MANIFEST.MF15
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/ComponentItemProvider.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/InstallableUnitItemProvider.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF64
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore5
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag19
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java65
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/Component.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/InstallableUnit.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java155
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/BasicMaterializationTaskImpl.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/ComponentImpl.java63
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/InstallableUnitImpl.java65
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MaterializationTaskImpl.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/P2TaskImpl.java79
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupFactoryImpl.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java57
18 files changed, 669 insertions, 135 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.releng.setup.edit/META-INF/MANIFEST.MF
index 312d3737c3..637982bc72 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/META-INF/MANIFEST.MF
@@ -10,11 +10,12 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.emf.cdo.releng.setup.provider;version="1.0.0"
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.emf.cdo.releng.setup;visibility:=reexport;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.emf.edit;visibility:=reexport;bundle-version="[2.5.0,3.0.0)",
- org.eclipse.emf.cdo.releng.workingsets;visibility:=reexport;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.emf.cdo.releng.workingsets.edit;visibility:=reexport;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.emf.cdo.releng.predicates;visibility:=reexport;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.emf.cdo.releng.predicates.edit;visibility:=reexport;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.net4j.util;bundle-version="[3.4.0,4.0.0)"
+ org.eclipse.emf.cdo.releng.setup;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.edit;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.releng.workingsets;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.releng.workingsets.edit;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.releng.predicates;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.releng.predicates.edit;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.net4j.util;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.equinox.p2.metadata;bundle-version="[2.2.0,3.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties b/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
index bb041f1337..502fe2f344 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
@@ -208,3 +208,5 @@ _UI_JRETask_version_feature = Version
_UI_JRETask_location_feature = Location
_UI_SetupTaskScope_Configuration_literal = Configuration
_UI_ApiBaselineTask_containerFolder_feature = Container Folder
+_UI_InstallableUnit_versionRange_feature = Version Range
+_UI_Component_versionRange_feature = Version Range
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/ComponentItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/ComponentItemProvider.java
index a8c32d874b..b3a411dee3 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/ComponentItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/ComponentItemProvider.java
@@ -28,6 +28,8 @@ import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
import java.util.Collection;
import java.util.List;
@@ -66,6 +68,7 @@ public class ComponentItemProvider extends ItemProviderAdapter implements IEditi
addNamePropertyDescriptor(object);
addTypePropertyDescriptor(object);
+ addVersionRangePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -103,10 +106,25 @@ public class ComponentItemProvider extends ItemProviderAdapter implements IEditi
}
/**
+ * This adds a property descriptor for the Version Range feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
+ protected void addVersionRangePropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Component_versionRange_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Component_versionRange_feature", "_UI_Component_type"),
+ SetupPackage.Literals.COMPONENT__VERSION_RANGE, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public boolean hasChildren(Object object)
{
@@ -146,7 +164,10 @@ public class ComponentItemProvider extends ItemProviderAdapter implements IEditi
public String getText(Object object)
{
Component component = (Component)object;
- return "" + component.getName() + " (" + component.getType() + ")";
+ VersionRange versionRange = component.getVersionRange();
+ return "" + component.getName()
+ + (versionRange == null || VersionRange.emptyRange.equals(versionRange) ? "" : " " + versionRange.toString())
+ + " - " + component.getType();
}
/**
@@ -165,6 +186,7 @@ public class ComponentItemProvider extends ItemProviderAdapter implements IEditi
{
case SetupPackage.COMPONENT__NAME:
case SetupPackage.COMPONENT__TYPE:
+ case SetupPackage.COMPONENT__VERSION_RANGE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/InstallableUnitItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/InstallableUnitItemProvider.java
index a03e4c3296..845e23371f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/InstallableUnitItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/InstallableUnitItemProvider.java
@@ -28,6 +28,8 @@ import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
import java.util.Collection;
import java.util.List;
@@ -65,6 +67,7 @@ public class InstallableUnitItemProvider extends ItemProviderAdapter implements
super.getPropertyDescriptors(object);
addIDPropertyDescriptor(object);
+ addVersionRangePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -86,10 +89,27 @@ public class InstallableUnitItemProvider extends ItemProviderAdapter implements
}
/**
+ * This adds a property descriptor for the Version Range feature.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
+ protected void addVersionRangePropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_InstallableUnit_versionRange_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_InstallableUnit_versionRange_feature",
+ "_UI_InstallableUnit_type"), SetupPackage.Literals.INSTALLABLE_UNIT__VERSION_RANGE, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public boolean hasChildren(Object object)
{
@@ -128,8 +148,11 @@ public class InstallableUnitItemProvider extends ItemProviderAdapter implements
@Override
public String getText(Object object)
{
- String label = ((InstallableUnit)object).getID();
- return label == null || label.length() == 0 ? getString("_UI_InstallableUnit_type") : label;
+ InstallableUnit installableUnit = (InstallableUnit)object;
+ String label = installableUnit.getID();
+ VersionRange versionRange = installableUnit.getVersionRange();
+ return (label == null || label.length() == 0 ? getString("_UI_InstallableUnit_type") : label)
+ + (versionRange == null || VersionRange.emptyRange.equals(versionRange) ? "" : " " + versionRange.toString());
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF
index 5e98499251..f04be4c24f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF
@@ -8,33 +8,33 @@ Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.emf.cdo.releng.workingsets;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
- org.eclipse.emf.cdo.releng.predicates;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
- org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.releng.workingsets;visibility:=reexport;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.emf.cdo.releng.predicates;visibility:=reexport;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.5.0,3.0.0)",
org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
- org.eclipse.core.variables;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.pde.core;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
- org.eclipse.pde.api.tools;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
- org.eclipse.team.ui;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
- javaewah;bundle-version="[0.0.0,1.0.0)";resolution:=optional,
- org.eclipse.jgit;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.egit;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.egit.core;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.egit.ui;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.emf.edit.ui;bundle-version="[2.5.0,3.0.0)";resolution:=optional,
- org.eclipse.ecf.provider.filetransfer;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
- org.eclipse.ecf.filetransfer;bundle-version="[5.0.0,6.0.0)";resolution:=optional,
- org.eclipse.ecf.identity;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
- org.eclipse.ecf;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
- org.eclipse.buckminster.sax;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
- org.eclipse.buckminster.cmdline;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
- org.eclipse.buckminster.download;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
- org.eclipse.buckminster.runtime;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
- org.eclipse.buckminster.core;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
- org.eclipse.buckminster.pde;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
+ org.eclipse.core.resources;resolution:=optional;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.variables;resolution:=optional;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.pde.core;resolution:=optional;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.pde.api.tools;resolution:=optional;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.team.ui;resolution:=optional;bundle-version="[3.5.0,4.0.0)",
+ javaewah;resolution:=optional;bundle-version="[0.0.0,1.0.0)",
+ org.eclipse.jgit;resolution:=optional;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.egit;resolution:=optional;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.egit.core;resolution:=optional;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.egit.ui;resolution:=optional;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.emf.edit.ui;resolution:=optional;bundle-version="[2.5.0,3.0.0)",
+ org.eclipse.ecf.provider.filetransfer;resolution:=optional;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.ecf.filetransfer;resolution:=optional;bundle-version="[5.0.0,6.0.0)",
+ org.eclipse.ecf.identity;resolution:=optional;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.ecf;resolution:=optional;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.buckminster.sax;resolution:=optional;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.buckminster.cmdline;resolution:=optional;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.buckminster.download;resolution:=optional;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.buckminster.runtime;resolution:=optional;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.buckminster.core;resolution:=optional;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.buckminster.pde;resolution:=optional;bundle-version="[1.0.0,2.0.0)",
org.eclipse.equinox.p2.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.equinox.p2.ui;bundle-version="[2.0.0,3.0.0)";resolution:=optional,
+ org.eclipse.equinox.p2.ui;resolution:=optional;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.metadata;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.repository;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.artifact.repository;bundle-version="[1.0.0,2.0.0)",
@@ -53,13 +53,13 @@ Require-Bundle: org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
org.eclipse.ecf.provider.filetransfer.httpclient4;bundle-version="[1.0.0,2.0.0)",
org.eclipse.core.net;bundle-version="[1.2.0,2.0.0)",
org.eclipse.jface.text;bundle-version="[3.8.0,4.0.0)",
- org.eclipse.buckminster.model.common;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
- org.eclipse.buckminster.mspec;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
- org.eclipse.buckminster.rmap;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
- org.eclipse.mylyn.tasks.ui;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.mylyn.tasks.core;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.jdt.launching;bundle-version="[3.7.0,4.0.0)";resolution:=optional,
- org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)";resolution:=optional
+ org.eclipse.buckminster.model.common;resolution:=optional;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.buckminster.mspec;resolution:=optional;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.buckminster.rmap;resolution:=optional;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.mylyn.tasks.ui;resolution:=optional;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.mylyn.tasks.core;resolution:=optional;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.jdt.launching;resolution:=optional;bundle-version="[3.7.0,4.0.0)",
+ org.eclipse.ui.ide;resolution:=optional;bundle-version="[3.5.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.emf.cdo.releng.internal.setup;x-friends:="org.eclipse.emf.cdo.releng.setup.installer,org.eclipse.emf.cdo.releng.setup.editor";version="1.0.0",
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
index 0f76189bbc..9e2753e07a 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
@@ -112,6 +112,8 @@
<details key="name" value="id"/>
</eAnnotations>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="versionRange" eType="#//VersionRange"
+ defaultValueLiteral="0.0.0"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="P2Repository">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="uRL" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
@@ -142,6 +144,8 @@
<eClassifiers xsi:type="ecore:EClass" name="Component">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="#//ComponentType"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="versionRange" eType="#//VersionRange"
+ defaultValueLiteral="0.0.0"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SourceLocator" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="ManualSourceLocator" eSuperTypes="#//SourceLocator">
@@ -310,4 +314,5 @@
<eLiterals name="FLOAT" value="12"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EDataType" name="LicenseInfo" instanceClassName="org.eclipse.emf.cdo.releng.setup.LicenseInfo"/>
+ <eClassifiers xsi:type="ecore:EDataType" name="VersionRange" instanceClassName="org.eclipse.equinox.p2.metadata.VersionRange"/>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag
index 743e15036e..6978e9be6d 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag
@@ -119,6 +119,14 @@
<children xmi:type="notation:Node" xmi:id="_mgNekOoOEeKpRf481yfX-g" type="1001">
<children xmi:type="notation:Node" xmi:id="_mgOFoOoOEeKpRf481yfX-g" type="4001"/>
<children xmi:type="notation:Node" xmi:id="_mgOssOoOEeKpRf481yfX-g" type="5001">
+ <children xmi:type="notation:Node" xmi:id="_lI6MkFRKEeOQl9znoIMr6g" type="2001">
+ <element xmi:type="ecore:EAttribute" href="setup.ecore#//InstallableUnit/iD"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_lI6MkVRKEeOQl9znoIMr6g"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_4fveYFRKEeOQl9znoIMr6g" type="2001">
+ <element xmi:type="ecore:EAttribute" href="setup.ecore#//InstallableUnit/versionRange"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_4fveYVRKEeOQl9znoIMr6g"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_mgOsseoOEeKpRf481yfX-g"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_mgOssuoOEeKpRf481yfX-g"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_mgOss-oOEeKpRf481yfX-g"/>
@@ -722,6 +730,10 @@
<element xmi:type="ecore:EAttribute" href="setup.ecore#//Component/type"/>
<layoutConstraint xmi:type="notation:Location" xmi:id="_K6zP0UMFEeO5EtrbFL2WrA"/>
</children>
+ <children xmi:type="notation:Node" xmi:id="_stKBIFRKEeOQl9znoIMr6g" type="2001">
+ <element xmi:type="ecore:EAttribute" href="setup.ecore#//Component/versionRange"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_stKBIVRKEeOQl9znoIMr6g"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_EqUJMkMFEeO5EtrbFL2WrA"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_EqUJM0MFEeO5EtrbFL2WrA"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_EqUJNEMFEeO5EtrbFL2WrA"/>
@@ -1085,6 +1097,13 @@
<element xmi:type="ecore:EClass" href="setup.ecore#//JRETask"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_P-0CglM7EeOOkf6A-Uv5-Q" x="1245" y="1185"/>
</children>
+ <children xmi:type="notation:Node" xmi:id="_VnOAUFRKEeOQl9znoIMr6g" type="1004">
+ <children xmi:type="notation:Node" xmi:id="_VnP1gFRKEeOQl9znoIMr6g" type="4008"/>
+ <children xmi:type="notation:Node" xmi:id="_VnP1gVRKEeOQl9znoIMr6g" type="4009"/>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_VnOAUVRKEeOQl9znoIMr6g" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="8047085" lineColor="8421504"/>
+ <element xmi:type="ecore:EDataType" href="setup.ecore#//VersionRange"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VnOAUlRKEeOQl9znoIMr6g" x="1200" y="765"/>
+ </children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_u_e_seoIEeKpRf481yfX-g"/>
<element xmi:type="ecore:EPackage" href="setup.ecore#/"/>
<edges xmi:type="notation:Edge" xmi:id="_4esFEOoIEeKpRf481yfX-g" type="3002" source="_zoytIOoIEeKpRf481yfX-g" target="_2Y42MOoIEeKpRf481yfX-g">
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java
index abce659a70..9f014ad69e 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java
@@ -42,8 +42,13 @@ import org.eclipse.emf.ecore.resource.Resource.Internal;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
@@ -450,10 +455,63 @@ public class SetupTaskPerformer extends AbstractSetupTaskContext
}
}
- private void doPerform(EList<SetupTask> neededTasks) throws Exception
+ public static boolean disableAutoBuilding() throws CoreException
{
+ boolean autoBuilding = ResourcesPlugin.getWorkspace().isAutoBuilding();
+ if (autoBuilding)
+ {
+ restoreAutoBuilding(false);
+ }
+
+ return autoBuilding;
+ }
+
+ public static void restoreAutoBuilding(boolean autoBuilding) throws CoreException
+ {
+ if (autoBuilding != ResourcesPlugin.getWorkspace().isAutoBuilding())
+ {
+ IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
+ description.setAutoBuilding(autoBuilding);
+
+ ResourcesPlugin.getWorkspace().setDescription(description);
+ }
+ }
+
+ private void doPerform(final EList<SetupTask> neededTasks) throws Exception
+ {
+ if (getTrigger() == Trigger.BOOTSTRAP)
+ {
+ doPerformHelper(neededTasks);
+ }
+ else
+ {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable()
+ {
+ public void run(IProgressMonitor monitor) throws CoreException
+ {
+ try
+ {
+ doPerformHelper(neededTasks);
+ }
+ catch (Exception ex)
+ {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex));
+ }
+ }
+ }, null);
+ }
+ }
+
+ private void doPerformHelper(EList<SetupTask> neededTasks) throws Exception
+ {
+ Boolean autoBuilding = null;
try
{
+ if (getTrigger() != Trigger.BOOTSTRAP)
+ {
+ autoBuilding = disableAutoBuilding();
+ }
+
Branch branch = getSetup().getBranch();
log("Setting up " + branch.getProject().getName() + " " + branch.getName());
@@ -481,6 +539,11 @@ public class SetupTaskPerformer extends AbstractSetupTaskContext
logStream.println();
IOUtil.closeSilent(logStream);
}
+
+ if (autoBuilding != null)
+ {
+ restoreAutoBuilding(autoBuilding);
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/Component.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/Component.java
index 7943e3d360..4a7b9cf3b0 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/Component.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/Component.java
@@ -12,6 +12,8 @@ package org.eclipse.emf.cdo.releng.setup;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Component</b></em>'.
@@ -22,6 +24,7 @@ import org.eclipse.emf.ecore.EObject;
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.Component#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.Component#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.Component#getVersionRange <em>Version Range</em>}</li>
* </ul>
* </p>
*
@@ -86,4 +89,31 @@ public interface Component extends EObject
*/
void setType(ComponentType value);
+ /**
+ * Returns the value of the '<em><b>Version Range</b></em>' attribute.
+ * The default value is <code>"0.0.0"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Version Range</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Version Range</em>' attribute.
+ * @see #setVersionRange(VersionRange)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getComponent_VersionRange()
+ * @model default="0.0.0" dataType="org.eclipse.emf.cdo.releng.setup.VersionRange"
+ * @generated
+ */
+ VersionRange getVersionRange();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.Component#getVersionRange <em>Version Range</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Version Range</em>' attribute.
+ * @see #getVersionRange()
+ * @generated
+ */
+ void setVersionRange(VersionRange value);
+
} // Component
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/InstallableUnit.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/InstallableUnit.java
index 673c2ef833..088f1aafa4 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/InstallableUnit.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/InstallableUnit.java
@@ -12,6 +12,8 @@ package org.eclipse.emf.cdo.releng.setup;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Installable Unit</b></em>'.
@@ -21,6 +23,7 @@ import org.eclipse.emf.ecore.EObject;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.InstallableUnit#getID <em>ID</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.InstallableUnit#getVersionRange <em>Version Range</em>}</li>
* </ul>
* </p>
*
@@ -57,4 +60,31 @@ public interface InstallableUnit extends EObject
*/
void setID(String value);
+ /**
+ * Returns the value of the '<em><b>Version Range</b></em>' attribute.
+ * The default value is <code>"0.0.0"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Version Range</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Version Range</em>' attribute.
+ * @see #setVersionRange(VersionRange)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getInstallableUnit_VersionRange()
+ * @model default="0.0.0" dataType="org.eclipse.emf.cdo.releng.setup.VersionRange"
+ * @generated
+ */
+ VersionRange getVersionRange();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.InstallableUnit#getVersionRange <em>Version Range</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Version Range</em>' attribute.
+ * @see #getVersionRange()
+ * @generated
+ */
+ void setVersionRange(VersionRange value);
+
} // InstallableUnit
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java
index 41c3f15ad3..1907236260 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java
@@ -1265,13 +1265,22 @@ public interface SetupPackage extends EPackage
int INSTALLABLE_UNIT__ID = 0;
/**
- * The number of structural features of the '<em>Installable Unit</em>' class.
+ * The feature id for the '<em><b>Version Range</b></em>' attribute.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
* @generated
* @ordered
*/
- int INSTALLABLE_UNIT_FEATURE_COUNT = 1;
+ int INSTALLABLE_UNIT__VERSION_RANGE = 1;
+
+ /**
+ * The number of structural features of the '<em>Installable Unit</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INSTALLABLE_UNIT_FEATURE_COUNT = 2;
/**
* The feature id for the '<em><b>URL</b></em>' attribute.
@@ -1589,13 +1598,22 @@ public interface SetupPackage extends EPackage
int COMPONENT__TYPE = 1;
/**
- * The number of structural features of the '<em>Component</em>' class.
+ * The feature id for the '<em><b>Version Range</b></em>' attribute.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
* @generated
* @ordered
*/
- int COMPONENT_FEATURE_COUNT = 2;
+ int COMPONENT__VERSION_RANGE = 2;
+
+ /**
+ * The number of structural features of the '<em>Component</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPONENT_FEATURE_COUNT = 3;
/**
* The number of structural features of the '<em>Source Locator</em>' class.
@@ -2976,13 +2994,23 @@ public interface SetupPackage extends EPackage
int LICENSE_INFO = 47;
/**
- * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.Eclipse <em>Eclipse</em>}'.
+ * The meta object id for the '<em>Version Range</em>' data type.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Eclipse</em>'.
- * @see org.eclipse.emf.cdo.releng.setup.Eclipse
+ * <!-- end-user-doc -->
+ * @see org.eclipse.equinox.p2.metadata.VersionRange
+ * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getVersionRange()
* @generated
*/
+ int VERSION_RANGE = 48;
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.Eclipse <em>Eclipse</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Eclipse</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.Eclipse
+ * @generated
+ */
EClass getEclipse();
/**
@@ -3339,13 +3367,24 @@ public interface SetupPackage extends EPackage
EAttribute getInstallableUnit_ID();
/**
- * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.P2Repository <em>P2 Repository</em>}'.
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.InstallableUnit#getVersionRange <em>Version Range</em>}'.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>P2 Repository</em>'.
- * @see org.eclipse.emf.cdo.releng.setup.P2Repository
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version Range</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.InstallableUnit#getVersionRange()
+ * @see #getInstallableUnit()
* @generated
*/
+ EAttribute getInstallableUnit_VersionRange();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.P2Repository <em>P2 Repository</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>P2 Repository</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.P2Repository
+ * @generated
+ */
EClass getP2Repository();
/**
@@ -4218,13 +4257,24 @@ public interface SetupPackage extends EPackage
EAttribute getComponent_Type();
/**
- * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.EclipseIniTask <em>Eclipse Ini Task</em>}'.
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.Component#getVersionRange <em>Version Range</em>}'.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Eclipse Ini Task</em>'.
- * @see org.eclipse.emf.cdo.releng.setup.EclipseIniTask
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version Range</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.Component#getVersionRange()
+ * @see #getComponent()
* @generated
*/
+ EAttribute getComponent_VersionRange();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.EclipseIniTask <em>Eclipse Ini Task</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Eclipse Ini Task</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.EclipseIniTask
+ * @generated
+ */
EClass getEclipseIniTask();
/**
@@ -4503,14 +4553,25 @@ public interface SetupPackage extends EPackage
EDataType getLicenseInfo();
/**
- * Returns the meta object for data type '{@link java.lang.Exception <em>Exception</em>}'.
+ * Returns the meta object for data type '{@link org.eclipse.equinox.p2.metadata.VersionRange <em>Version Range</em>}'.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Exception</em>'.
- * @see java.lang.Exception
- * @model instanceClass="java.lang.Exception"
+ * <!-- end-user-doc -->
+ * @return the meta object for data type '<em>Version Range</em>'.
+ * @see org.eclipse.equinox.p2.metadata.VersionRange
+ * @model instanceClass="org.eclipse.equinox.p2.metadata.VersionRange"
* @generated
*/
+ EDataType getVersionRange();
+
+ /**
+ * Returns the meta object for data type '{@link java.lang.Exception <em>Exception</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for data type '<em>Exception</em>'.
+ * @see java.lang.Exception
+ * @model instanceClass="java.lang.Exception"
+ * @generated
+ */
EDataType getException();
/**
@@ -4823,13 +4884,21 @@ public interface SetupPackage extends EPackage
EAttribute INSTALLABLE_UNIT__ID = eINSTANCE.getInstallableUnit_ID();
/**
- * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.setup.impl.P2RepositoryImpl <em>P2 Repository</em>}' class.
+ * The meta object literal for the '<em><b>Version Range</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.cdo.releng.setup.impl.P2RepositoryImpl
- * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getP2Repository()
* @generated
*/
+ EAttribute INSTALLABLE_UNIT__VERSION_RANGE = eINSTANCE.getInstallableUnit_VersionRange();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.setup.impl.P2RepositoryImpl <em>P2 Repository</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.releng.setup.impl.P2RepositoryImpl
+ * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getP2Repository()
+ * @generated
+ */
EClass P2_REPOSITORY = eINSTANCE.getP2Repository();
/**
@@ -5525,13 +5594,21 @@ public interface SetupPackage extends EPackage
EAttribute COMPONENT__TYPE = eINSTANCE.getComponent_Type();
/**
- * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.setup.impl.EclipseIniTaskImpl <em>Eclipse Ini Task</em>}' class.
+ * The meta object literal for the '<em><b>Version Range</b></em>' attribute feature.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.cdo.releng.setup.impl.EclipseIniTaskImpl
- * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getEclipseIniTask()
+ * <!-- end-user-doc -->
* @generated
*/
+ EAttribute COMPONENT__VERSION_RANGE = eINSTANCE.getComponent_VersionRange();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.setup.impl.EclipseIniTaskImpl <em>Eclipse Ini Task</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.releng.setup.impl.EclipseIniTaskImpl
+ * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getEclipseIniTask()
+ * @generated
+ */
EClass ECLIPSE_INI_TASK = eINSTANCE.getEclipseIniTask();
/**
@@ -5769,13 +5846,23 @@ public interface SetupPackage extends EPackage
EDataType LICENSE_INFO = eINSTANCE.getLicenseInfo();
/**
- * The meta object literal for the '<em>Exception</em>' data type.
+ * The meta object literal for the '<em>Version Range</em>' data type.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.Exception
- * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getException()
+ * <!-- end-user-doc -->
+ * @see org.eclipse.equinox.p2.metadata.VersionRange
+ * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getVersionRange()
* @generated
*/
+ EDataType VERSION_RANGE = eINSTANCE.getVersionRange();
+
+ /**
+ * The meta object literal for the '<em>Exception</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see java.lang.Exception
+ * @see org.eclipse.emf.cdo.releng.setup.impl.SetupPackageImpl#getException()
+ * @generated
+ */
EDataType EXCEPTION = eINSTANCE.getException();
/**
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/BasicMaterializationTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/BasicMaterializationTaskImpl.java
index 5d9ba3f774..f9d145b596 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/BasicMaterializationTaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/BasicMaterializationTaskImpl.java
@@ -26,8 +26,10 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.buckminster.core.CorePlugin;
+import org.eclipse.buckminster.core.materializer.InstallerJob;
import org.eclipse.buckminster.core.materializer.MaterializationContext;
import org.eclipse.buckminster.core.materializer.MaterializationJob;
+import org.eclipse.buckminster.core.materializer.MaterializerJob;
import org.eclipse.buckminster.core.metadata.model.BillOfMaterials;
import org.eclipse.buckminster.core.mspec.builder.MaterializationSpecBuilder;
import org.eclipse.buckminster.core.mspec.model.MaterializationSpec;
@@ -37,10 +39,9 @@ import org.eclipse.buckminster.core.resolver.IResolver;
import org.eclipse.buckminster.core.resolver.MainResolver;
import org.eclipse.buckminster.core.resolver.ResolutionContext;
import org.eclipse.buckminster.download.DownloadManager;
+import org.eclipse.buckminster.runtime.BuckminsterException;
import org.eclipse.buckminster.runtime.Logger;
import org.eclipse.buckminster.runtime.MonitorUtils;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -55,6 +56,7 @@ import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Queue;
import java.util.Set;
import java.util.regex.Pattern;
@@ -318,7 +320,6 @@ public abstract class BasicMaterializationTaskImpl extends SetupTaskImpl impleme
}
FileLock tpPoolLock = null;
- boolean isAutoBuilding = disableAutoBuilding();
try
{
@@ -355,16 +356,9 @@ public abstract class BasicMaterializationTaskImpl extends SetupTaskImpl impleme
}
finally
{
- try
- {
- if (tpPoolLock != null)
- {
- tpPoolLock.release();
- }
- }
- finally
+ if (tpPoolLock != null)
{
- restoreAutoBuilding(isAutoBuilding);
+ tpPoolLock.release();
}
}
@@ -379,28 +373,6 @@ public abstract class BasicMaterializationTaskImpl extends SetupTaskImpl impleme
}
}
- public static boolean disableAutoBuilding() throws CoreException
- {
- boolean autoBuilding = ResourcesPlugin.getWorkspace().isAutoBuilding();
- if (autoBuilding)
- {
- restoreAutoBuilding(false);
- }
-
- return autoBuilding;
- }
-
- public static void restoreAutoBuilding(boolean autoBuilding) throws CoreException
- {
- if (autoBuilding != ResourcesPlugin.getWorkspace().isAutoBuilding())
- {
- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
- description.setAutoBuilding(autoBuilding);
-
- ResourcesPlugin.getWorkspace().setDescription(description);
- }
- }
-
private static File updateTargetPlatformPool(SetupTaskContext context) throws Exception
{
File installFolder = new File(context.getSetup().getPreferences().getInstallFolder());
@@ -549,6 +521,28 @@ public abstract class BasicMaterializationTaskImpl extends SetupTaskImpl impleme
IOUtil.close(printStream);
}
}
+
+ @Override
+ protected void internalRun(IProgressMonitor monitor, boolean waitForCompletion) throws CoreException
+ {
+ MaterializationContext context = getMaterializationContext();
+ BillOfMaterials bom = context.getBillOfMaterials();
+
+ Queue<MaterializerJob> allJobs = prepareJobs(monitor, bom);
+
+ if (allJobs != null)
+ {
+ triggerJobs(monitor, allJobs);
+ waitForJobs(monitor, allJobs, bom);
+ }
+ if (context.getStatus().getSeverity() == IStatus.ERROR)
+ {
+ throw BuckminsterException.wrap(context.getStatus());
+ }
+
+ InstallerJob installerJob = new InstallerJob(context, !waitForCompletion);
+ installerJob.run(monitor);
+ }
};
job.run(MonitorUtils.subMonitor(monitor, 80));
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/ComponentImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/ComponentImpl.java
index c7545b1581..f4fbea541b 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/ComponentImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/ComponentImpl.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.releng.setup.impl;
import org.eclipse.emf.cdo.releng.setup.Component;
import org.eclipse.emf.cdo.releng.setup.ComponentType;
+import org.eclipse.emf.cdo.releng.setup.SetupFactory;
import org.eclipse.emf.cdo.releng.setup.SetupPackage;
import org.eclipse.emf.common.notify.Notification;
@@ -19,6 +20,8 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Component</b></em>'.
@@ -28,6 +31,7 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.ComponentImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.ComponentImpl#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.ComponentImpl#getVersionRange <em>Version Range</em>}</li>
* </ul>
* </p>
*
@@ -76,10 +80,31 @@ public class ComponentImpl extends MinimalEObjectImpl.Container implements Compo
protected ComponentType type = TYPE_EDEFAULT;
/**
+ * The default value of the '{@link #getVersionRange() <em>Version Range</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @see #getVersionRange()
* @generated
+ * @ordered
*/
+ protected static final VersionRange VERSION_RANGE_EDEFAULT = (VersionRange)SetupFactory.eINSTANCE.createFromString(
+ SetupPackage.eINSTANCE.getVersionRange(), "0.0.0");
+
+ /**
+ * The cached value of the '{@link #getVersionRange() <em>Version Range</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVersionRange()
+ * @generated
+ * @ordered
+ */
+ protected VersionRange versionRange = VERSION_RANGE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
protected ComponentImpl()
{
super();
@@ -151,6 +176,32 @@ public class ComponentImpl extends MinimalEObjectImpl.Container implements Compo
* <!-- end-user-doc -->
* @generated
*/
+ public VersionRange getVersionRange()
+ {
+ return versionRange;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVersionRange(VersionRange newVersionRange)
+ {
+ VersionRange oldVersionRange = versionRange;
+ versionRange = newVersionRange;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.COMPONENT__VERSION_RANGE, oldVersionRange,
+ versionRange));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
@@ -160,6 +211,8 @@ public class ComponentImpl extends MinimalEObjectImpl.Container implements Compo
return getName();
case SetupPackage.COMPONENT__TYPE:
return getType();
+ case SetupPackage.COMPONENT__VERSION_RANGE:
+ return getVersionRange();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -180,6 +233,9 @@ public class ComponentImpl extends MinimalEObjectImpl.Container implements Compo
case SetupPackage.COMPONENT__TYPE:
setType((ComponentType)newValue);
return;
+ case SetupPackage.COMPONENT__VERSION_RANGE:
+ setVersionRange((VersionRange)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -200,6 +256,9 @@ public class ComponentImpl extends MinimalEObjectImpl.Container implements Compo
case SetupPackage.COMPONENT__TYPE:
setType(TYPE_EDEFAULT);
return;
+ case SetupPackage.COMPONENT__VERSION_RANGE:
+ setVersionRange(VERSION_RANGE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -218,6 +277,8 @@ public class ComponentImpl extends MinimalEObjectImpl.Container implements Compo
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case SetupPackage.COMPONENT__TYPE:
return type != TYPE_EDEFAULT;
+ case SetupPackage.COMPONENT__VERSION_RANGE:
+ return VERSION_RANGE_EDEFAULT == null ? versionRange != null : !VERSION_RANGE_EDEFAULT.equals(versionRange);
}
return super.eIsSet(featureID);
}
@@ -240,6 +301,8 @@ public class ComponentImpl extends MinimalEObjectImpl.Container implements Compo
result.append(name);
result.append(", type: ");
result.append(type);
+ result.append(", versionRange: ");
+ result.append(versionRange);
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/InstallableUnitImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/InstallableUnitImpl.java
index 7f9b30f5ee..b529bf3319 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/InstallableUnitImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/InstallableUnitImpl.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.releng.setup.impl;
import org.eclipse.emf.cdo.releng.setup.InstallableUnit;
+import org.eclipse.emf.cdo.releng.setup.SetupFactory;
import org.eclipse.emf.cdo.releng.setup.SetupPackage;
import org.eclipse.emf.common.notify.Notification;
@@ -18,6 +19,8 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Installable Unit</b></em>'.
@@ -26,6 +29,7 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.InstallableUnitImpl#getID <em>ID</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.InstallableUnitImpl#getVersionRange <em>Version Range</em>}</li>
* </ul>
* </p>
*
@@ -54,10 +58,31 @@ public class InstallableUnitImpl extends MinimalEObjectImpl.Container implements
protected String iD = ID_EDEFAULT;
/**
+ * The default value of the '{@link #getVersionRange() <em>Version Range</em>}' attribute.
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVersionRange()
* @generated
+ * @ordered
*/
+ protected static final VersionRange VERSION_RANGE_EDEFAULT = (VersionRange)SetupFactory.eINSTANCE.createFromString(
+ SetupPackage.eINSTANCE.getVersionRange(), "0.0.0");
+
+ /**
+ * The cached value of the '{@link #getVersionRange() <em>Version Range</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVersionRange()
+ * @generated
+ * @ordered
+ */
+ protected VersionRange versionRange = VERSION_RANGE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
protected InstallableUnitImpl()
{
super();
@@ -104,6 +129,32 @@ public class InstallableUnitImpl extends MinimalEObjectImpl.Container implements
* <!-- end-user-doc -->
* @generated
*/
+ public VersionRange getVersionRange()
+ {
+ return versionRange;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVersionRange(VersionRange newVersionRange)
+ {
+ VersionRange oldVersionRange = versionRange;
+ versionRange = newVersionRange;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.INSTALLABLE_UNIT__VERSION_RANGE,
+ oldVersionRange, versionRange));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
@@ -111,6 +162,8 @@ public class InstallableUnitImpl extends MinimalEObjectImpl.Container implements
{
case SetupPackage.INSTALLABLE_UNIT__ID:
return getID();
+ case SetupPackage.INSTALLABLE_UNIT__VERSION_RANGE:
+ return getVersionRange();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -128,6 +181,9 @@ public class InstallableUnitImpl extends MinimalEObjectImpl.Container implements
case SetupPackage.INSTALLABLE_UNIT__ID:
setID((String)newValue);
return;
+ case SetupPackage.INSTALLABLE_UNIT__VERSION_RANGE:
+ setVersionRange((VersionRange)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -145,6 +201,9 @@ public class InstallableUnitImpl extends MinimalEObjectImpl.Container implements
case SetupPackage.INSTALLABLE_UNIT__ID:
setID(ID_EDEFAULT);
return;
+ case SetupPackage.INSTALLABLE_UNIT__VERSION_RANGE:
+ setVersionRange(VERSION_RANGE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -161,6 +220,8 @@ public class InstallableUnitImpl extends MinimalEObjectImpl.Container implements
{
case SetupPackage.INSTALLABLE_UNIT__ID:
return ID_EDEFAULT == null ? iD != null : !ID_EDEFAULT.equals(iD);
+ case SetupPackage.INSTALLABLE_UNIT__VERSION_RANGE:
+ return VERSION_RANGE_EDEFAULT == null ? versionRange != null : !VERSION_RANGE_EDEFAULT.equals(versionRange);
}
return super.eIsSet(featureID);
}
@@ -181,6 +242,8 @@ public class InstallableUnitImpl extends MinimalEObjectImpl.Container implements
StringBuffer result = new StringBuffer(super.toString());
result.append(" (iD: ");
result.append(iD);
+ result.append(", versionRange: ");
+ result.append(versionRange);
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MaterializationTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MaterializationTaskImpl.java
index 0f1c2a1633..2779aced0c 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MaterializationTaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MaterializationTaskImpl.java
@@ -58,6 +58,7 @@ import org.eclipse.buckminster.sax.Utils;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.metadata.VersionRange;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -340,9 +341,6 @@ public class MaterializationTaskImpl extends BasicMaterializationTaskImpl implem
mspec.setUrl("buckminster.cquery");
Map<String, String> properties = mspec.getProperties();
- // properties.put("target.os", "*");
- // properties.put("target.ws", "*");
- // properties.put("target.arch", "*");
properties.put("target.os", Platform.getOS());
properties.put("target.ws", Platform.getWS());
properties.put("target.arch", Platform.getOSArch());
@@ -397,6 +395,12 @@ public class MaterializationTaskImpl extends BasicMaterializationTaskImpl implem
ComponentRequestBuilder rootComponentRequestBuilder = new ComponentRequestBuilder();
rootComponentRequestBuilder.setName(rootComponent.getName());
rootComponentRequestBuilder.setComponentTypeID(rootComponent.getType().toString());
+ VersionRange versionRange = rootComponent.getVersionRange();
+ if (versionRange != null)
+ {
+ rootComponentRequestBuilder.setVersionRange(versionRange);
+ }
+
cspecBuilder.addDependency(rootComponentRequestBuilder.createComponentRequest());
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/P2TaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/P2TaskImpl.java
index 1256601b60..71ab44c293 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/P2TaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/P2TaskImpl.java
@@ -48,6 +48,7 @@ import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.internal.p2.director.app.DirectorApplication;
import org.eclipse.equinox.internal.p2.director.app.ILog;
import org.eclipse.equinox.internal.p2.director.app.Messages;
+import org.eclipse.equinox.internal.p2.director.app.PrettyQuery;
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.IProfile;
@@ -57,6 +58,8 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.ILicense;
import org.eclipse.equinox.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
+import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProvisioningJob;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
@@ -147,7 +150,7 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task
*/
protected boolean licenseConfirmationDisabled = LICENSE_CONFIRMATION_DISABLED_EDEFAULT;
- private transient Set<String> neededInstallableUnits;
+ private transient List<InstallableUnit> neededInstallableUnits;
/**
* <!-- begin-user-doc -->
@@ -353,9 +356,9 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task
return result.toString();
}
- private static Set<String> getInstalledUnits()
+ private static Set<IInstallableUnit> getInstalledUnits()
{
- Set<String> result = new HashSet<String>();
+ Set<IInstallableUnit> result = new HashSet<IInstallableUnit>();
ProvisioningUI provisioningUI = ProvisioningUI.getDefaultUI();
ProvisioningSession session = provisioningUI.getSession();
String profileId = provisioningUI.getProfileId();
@@ -364,7 +367,7 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task
for (IInstallableUnit installableUnit : queryResult)
{
- result.add(installableUnit.getId());
+ result.add(installableUnit);
}
return result;
@@ -412,19 +415,30 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task
return true;
}
- Set<String> installedUnits = getInstalledUnits();
- for (InstallableUnit installableUnit : getInstallableUnits())
+ Set<IInstallableUnit> installedUnits = getInstalledUnits();
+ LOOP: for (InstallableUnit installableUnit : getInstallableUnits())
{
String id = installableUnit.getID();
- if (!installedUnits.contains(id))
+ VersionRange versionRange = installableUnit.getVersionRange();
+ if (versionRange == null)
{
- if (neededInstallableUnits == null)
+ versionRange = VersionRange.emptyRange;
+ }
+
+ for (IInstallableUnit installedUnit : installedUnits)
+ {
+ if (id.equals(installedUnit.getId()) && versionRange.isIncluded(installedUnit.getVersion()))
{
- neededInstallableUnits = new HashSet<String>();
+ continue LOOP;
}
+ }
- neededInstallableUnits.add(id);
+ if (neededInstallableUnits == null)
+ {
+ neededInstallableUnits = new ArrayList<InstallableUnit>();
}
+
+ neededInstallableUnits.add(installableUnit);
}
Set<String> knownRepositories = getKnownRepositories();
@@ -485,9 +499,10 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task
if (neededInstallableUnits != null)
{
List<IInstallableUnit> toInstall = new ArrayList<IInstallableUnit>();
- for (String installableUnit : neededInstallableUnits)
+ for (InstallableUnit installableUnit : neededInstallableUnits)
{
- IQuery<IInstallableUnit> iuQuery = QueryUtil.createIUQuery(installableUnit);
+ IQuery<IInstallableUnit> iuQuery = QueryUtil.createIUQuery(installableUnit.getID(),
+ installableUnit.getVersionRange());
IInstallableUnit candidate = null;
for (IMetadataRepository repository : repositories)
{
@@ -512,7 +527,7 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task
// This will fail.
// TODO
InstallableUnitDescription installableUnitDescription = new InstallableUnitDescription();
- installableUnitDescription.setId(installableUnit);
+ installableUnitDescription.setId(installableUnit.getID());
toInstall.add(MetadataFactory.createInstallableUnit(installableUnitDescription));
}
}
@@ -770,6 +785,44 @@ public class P2TaskImpl extends SetupTaskImpl implements P2Task
}
}
+ @Override
+ public void processArguments(String[] args) throws CoreException
+ {
+ super.processArguments(args);
+
+ processIUs();
+ }
+
+ private void processIUs()
+ {
+ List<IQuery<IInstallableUnit>> rootsToInstall = getRootsToInstall();
+ rootsToInstall.clear();
+
+ for (InstallableUnit installableUnit : getInstallableUnits())
+ {
+ String id = installableUnit.getID();
+ VersionRange versionRange = installableUnit.getVersionRange();
+ if (versionRange == null)
+ {
+ versionRange = VersionRange.emptyRange;
+ }
+
+ IQuery<IInstallableUnit> query = new PrettyQuery<IInstallableUnit>(QueryUtil.createIUQuery(id,
+ Version.emptyVersion.equals(versionRange) ? VersionRange.emptyRange : versionRange), id + " "
+ + versionRange);
+ rootsToInstall.add(query);
+ }
+ }
+
+ private List<IQuery<IInstallableUnit>> getRootsToInstall()
+ {
+ Field field = ReflectUtil.getField(DirectorApplication.class, "rootsToInstall");
+ @SuppressWarnings("unchecked")
+ List<IQuery<IInstallableUnit>> rootsToInstall = (List<IQuery<IInstallableUnit>>)ReflectUtil.getValue(field,
+ this);
+ return rootsToInstall;
+ }
+
private IProvisioningAgent getTargetAgent()
{
Field field = ReflectUtil.getField(DirectorApplication.class, "targetAgent");
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupFactoryImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupFactoryImpl.java
index 579a59ab7e..7a7de8ab3c 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupFactoryImpl.java
@@ -61,6 +61,8 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
import java.util.HashSet;
import java.util.Set;
@@ -217,6 +219,8 @@ public class SetupFactoryImpl extends EFactoryImpl implements SetupFactory
return createURIFromString(eDataType, initialValue);
case SetupPackage.LICENSE_INFO:
return createLicenseInfoFromString(eDataType, initialValue);
+ case SetupPackage.VERSION_RANGE:
+ return createVersionRangeFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
@@ -248,6 +252,8 @@ public class SetupFactoryImpl extends EFactoryImpl implements SetupFactory
return convertURIToString(eDataType, instanceValue);
case SetupPackage.LICENSE_INFO:
return convertLicenseInfoToString(eDataType, instanceValue);
+ case SetupPackage.VERSION_RANGE:
+ return convertVersionRangeToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
@@ -784,9 +790,29 @@ public class SetupFactoryImpl extends EFactoryImpl implements SetupFactory
/**
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
+ * <!-- end-user-doc -->
+ * @generated NOT
*/
+ public VersionRange createVersionRangeFromString(EDataType eDataType, String initialValue)
+ {
+ return initialValue == null ? null : new VersionRange(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertVersionRangeToString(EDataType eDataType, Object instanceValue)
+ {
+ return instanceValue == null ? null : ((VersionRange)instanceValue).toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public Exception createExceptionFromString(EDataType eDataType, String initialValue)
{
return (Exception)super.createFromString(eDataType, initialValue);
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java
index c1501f3a1c..275f656909 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java
@@ -68,6 +68,8 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+
import java.util.Set;
/**
@@ -402,9 +404,16 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
/**
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
+ private EDataType versionRangeEDataType = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EDataType exceptionEDataType = null;
/**
@@ -805,9 +814,19 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
/**
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getInstallableUnit_VersionRange()
+ {
+ return (EAttribute)installableUnitEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getP2Repository()
{
return p2RepositoryEClass;
@@ -1625,9 +1644,19 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
/**
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getComponent_VersionRange()
+ {
+ return (EAttribute)componentEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getEclipseIniTask()
{
return eclipseIniTaskEClass;
@@ -1895,9 +1924,19 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
/**
* <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
+ public EDataType getVersionRange()
+ {
+ return versionRangeEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EDataType getException()
{
return exceptionEDataType;
@@ -2018,6 +2057,7 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
installableUnitEClass = createEClass(INSTALLABLE_UNIT);
createEAttribute(installableUnitEClass, INSTALLABLE_UNIT__ID);
+ createEAttribute(installableUnitEClass, INSTALLABLE_UNIT__VERSION_RANGE);
p2RepositoryEClass = createEClass(P2_REPOSITORY);
createEAttribute(p2RepositoryEClass, P2_REPOSITORY__URL);
@@ -2037,6 +2077,7 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
componentEClass = createEClass(COMPONENT);
createEAttribute(componentEClass, COMPONENT__NAME);
createEAttribute(componentEClass, COMPONENT__TYPE);
+ createEAttribute(componentEClass, COMPONENT__VERSION_RANGE);
sourceLocatorEClass = createEClass(SOURCE_LOCATOR);
@@ -2132,6 +2173,7 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
exceptionEDataType = createEDataType(EXCEPTION);
uriEDataType = createEDataType(URI);
licenseInfoEDataType = createEDataType(LICENSE_INFO);
+ versionRangeEDataType = createEDataType(VERSION_RANGE);
}
/**
@@ -2363,6 +2405,9 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getInstallableUnit_ID(), ecorePackage.getEString(), "iD", null, 1, 1, InstallableUnit.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getInstallableUnit_VersionRange(), getVersionRange(), "versionRange", "0.0.0", 0, 1,
+ InstallableUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
initEClass(p2RepositoryEClass, P2Repository.class, "P2Repository", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
@@ -2401,6 +2446,8 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getComponent_Type(), getComponentType(), "type", null, 1, 1, Component.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getComponent_VersionRange(), getVersionRange(), "versionRange", "0.0.0", 0, 1, Component.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(sourceLocatorEClass, SourceLocator.class, "SourceLocator", IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
@@ -2623,6 +2670,8 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
initEDataType(uriEDataType, org.eclipse.emf.common.util.URI.class, "URI", IS_SERIALIZABLE,
!IS_GENERATED_INSTANCE_CLASS);
initEDataType(licenseInfoEDataType, LicenseInfo.class, "LicenseInfo", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(versionRangeEDataType, VersionRange.class, "VersionRange", IS_SERIALIZABLE,
+ !IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);

Back to the top