Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2014-01-27 11:53:33 +0000
committerEike Stepper2014-01-27 12:35:37 +0000
commitc049df3a2c0991ed08dde28f28ccd24ca497d8d5 (patch)
tree127c79b4bf22227b626f229d4048e177cce9e11b
parentda5838868fc7f83265d3b405c68a751662ad6ff0 (diff)
downloadcdo-c049df3a2c0991ed08dde28f28ccd24ca497d8d5.tar.gz
cdo-c049df3a2c0991ed08dde28f28ccd24ca497d8d5.tar.xz
cdo-c049df3a2c0991ed08dde28f28ccd24ca497d8d5.zip
Improve setup related models; add Targlets
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties4
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletDataItemProvider.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletTaskItemProvider.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore2
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag12
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/plugin.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletBundleContainer.java518
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletProfileManager.java101
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TestAction.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java96
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/TargletData.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletDataImpl.java118
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletTaskImpl.java126
14 files changed, 898 insertions, 240 deletions
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 e8726b11de..613559131d 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
@@ -229,10 +229,13 @@ _UI_TargletContainer_targlets_feature = Targlets
_UI_TargletContainer_type = Targlet Container
_UI_TargletData_activeP2Repositories_feature = Active P2 Repositories
_UI_TargletData_activeRepositoryList_feature = Active Repository List
+_UI_TargletData_includeAllPlatforms_feature = Include All Platforms
+_UI_TargletData_includeSources_feature = Include Sources
_UI_TargletData_name_feature = Name
_UI_TargletData_repositoryLists_feature = Repository Lists
_UI_TargletData_roots_feature = Roots
_UI_TargletData_sourceLocators_feature = Source Locators
+_UI_TargletData_type = Targlet Data
_UI_TargletImportTask_targletURI_feature = Targlet URI
_UI_TargletImportTask_type = Targlet Import
_UI_TargletTask_type = Targlet
@@ -278,4 +281,3 @@ _UI_VariableType_URI_literal = URI
_UI_WorkingSetTask_type = Working Sets
_UI_WorkingSetTask_workingSetGroup_feature = Working Sets
_UI_WorkingSetTask_workingSets_feature = Working Sets
-_UI_TargletData_type = Targlet Data
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletDataItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletDataItemProvider.java
index 62d01a6333..96c6d02ac8 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletDataItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletDataItemProvider.java
@@ -60,6 +60,8 @@ public class TargletDataItemProvider extends ItemProviderAdapter implements IEdi
addNamePropertyDescriptor(object);
addActiveRepositoryListPropertyDescriptor(object);
+ addIncludeSourcesPropertyDescriptor(object);
+ addIncludeAllPlatformsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -98,6 +100,40 @@ public class TargletDataItemProvider extends ItemProviderAdapter implements IEdi
}
/**
+ * This adds a property descriptor for the Include Sources feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIncludeSourcesPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_TargletData_includeSources_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_TargletData_includeSources_feature",
+ "_UI_TargletData_type"), SetupPackage.Literals.TARGLET_DATA__INCLUDE_SOURCES, true, false, false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Include All Platforms feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIncludeAllPlatformsPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_TargletData_includeAllPlatforms_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_TargletData_includeAllPlatforms_feature",
+ "_UI_TargletData_type"), SetupPackage.Literals.TARGLET_DATA__INCLUDE_ALL_PLATFORMS, true, false, false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
@@ -183,6 +219,8 @@ public class TargletDataItemProvider extends ItemProviderAdapter implements IEdi
{
case SetupPackage.TARGLET_DATA__NAME:
case SetupPackage.TARGLET_DATA__ACTIVE_REPOSITORY_LIST:
+ case SetupPackage.TARGLET_DATA__INCLUDE_SOURCES:
+ case SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case SetupPackage.TARGLET_DATA__ROOTS:
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletTaskItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletTaskItemProvider.java
index 45d055df89..1950cd28c5 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletTaskItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/TargletTaskItemProvider.java
@@ -57,6 +57,8 @@ public class TargletTaskItemProvider extends SetupTaskItemProvider implements IE
addNamePropertyDescriptor(object);
addActiveRepositoryListPropertyDescriptor(object);
+ addIncludeSourcesPropertyDescriptor(object);
+ addIncludeAllPlatformsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -95,6 +97,40 @@ public class TargletTaskItemProvider extends SetupTaskItemProvider implements IE
}
/**
+ * This adds a property descriptor for the Include Sources feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIncludeSourcesPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_TargletData_includeSources_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_TargletData_includeSources_feature",
+ "_UI_TargletData_type"), SetupPackage.Literals.TARGLET_DATA__INCLUDE_SOURCES, true, false, false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Include All Platforms feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIncludeAllPlatformsPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_TargletData_includeAllPlatforms_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_TargletData_includeAllPlatforms_feature",
+ "_UI_TargletData_type"), SetupPackage.Literals.TARGLET_DATA__INCLUDE_ALL_PLATFORMS, true, false, false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
@@ -181,6 +217,8 @@ public class TargletTaskItemProvider extends SetupTaskItemProvider implements IE
{
case SetupPackage.TARGLET_TASK__NAME:
case SetupPackage.TARGLET_TASK__ACTIVE_REPOSITORY_LIST:
+ case SetupPackage.TARGLET_TASK__INCLUDE_SOURCES:
+ case SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case SetupPackage.TARGLET_TASK__ROOTS:
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 983ceaec8b..c8a1728de1 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
@@ -226,6 +226,8 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="activeP2Repositories" upperBound="-1"
eType="#//P2Repository" changeable="false" volatile="true" transient="true"
derived="true" resolveProxies="false"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="includeSources" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="includeAllPlatforms" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RepositoryList">
<eStructuralFeatures xsi:type="ecore:EReference" name="p2Repositories" upperBound="-1"
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 1c17b1176e..13910db346 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecorediag
@@ -1235,6 +1235,14 @@
<element xmi:type="ecore:EAttribute" href="setup.ecore#//TargletData/activeRepositoryList"/>
<layoutConstraint xmi:type="notation:Location" xmi:id="_w2yBMYJmEeO8te75KayH8A"/>
</children>
+ <children xmi:type="notation:Node" xmi:id="_2KrmwIcnEeOlU_tXctXy9g" type="2001">
+ <element xmi:type="ecore:EAttribute" href="setup.ecore#//TargletData/includeSources"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_2KrmwYcnEeOlU_tXctXy9g"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_3tZ9wIcnEeOlU_tXctXy9g" type="2001">
+ <element xmi:type="ecore:EAttribute" href="setup.ecore#//TargletData/includeAllPlatforms"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_3tZ9wYcnEeOlU_tXctXy9g"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_EUQsBYIDEeO8te75KayH8A"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_EUQsBoIDEeO8te75KayH8A"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_EUQsB4IDEeO8te75KayH8A"/>
@@ -1246,7 +1254,7 @@
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_EUQsAYIDEeO8te75KayH8A" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="8047085" lineColor="8421504"/>
<element xmi:type="ecore:EClass" href="setup.ecore#//TargletData"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EUQsAoIDEeO8te75KayH8A" x="1018" y="973"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EUQsAoIDEeO8te75KayH8A" x="1018" y="940"/>
</children>
<children xmi:type="notation:Node" xmi:id="_SwVUAIIDEeO8te75KayH8A" type="1001">
<children xmi:type="notation:Node" xmi:id="_SwVUA4IDEeO8te75KayH8A" type="4001"/>
@@ -1923,7 +1931,7 @@
<styles xmi:type="notation:ConnectorStyle" xmi:id="_PMRXYYIDEeO8te75KayH8A" routing="Rectilinear" lineColor="4210752"/>
<styles xmi:type="notation:FontStyle" xmi:id="_PMRXYoIDEeO8te75KayH8A" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
<element xmi:type="ecore:EReference" href="setup.ecore#//TargletData/roots"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PMRXY4IDEeO8te75KayH8A" points="[-72, -9, 134, 26]$[-132, -9, 74, 26]"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PMRXY4IDEeO8te75KayH8A" points="[-98, 7, 142, 26]$[-166, 7, 74, 26]"/>
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PMjrQIIDEeO8te75KayH8A" id="(0.6336633663366337,0.10294117647058823)"/>
</edges>
<edges xmi:type="notation:Edge" xmi:id="_jIRLwIIDEeO8te75KayH8A" type="3002" source="_SwVUAIIDEeO8te75KayH8A" target="_q3yi0OoOEeKpRf481yfX-g">
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/plugin.xml b/plugins/org.eclipse.emf.cdo.releng.setup/plugin.xml
index eeec8d72e6..865fda441e 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/plugin.xml
@@ -97,7 +97,7 @@
class="org.eclipse.emf.cdo.releng.internal.setup.targlets.TargletUIFactory$NewTargletWizard"
icon="icons/targlets.gif"
id="org.eclipse.emf.cdo.releng.setup.TargletProvisioner"
- name="Targlet">
+ name="Targlet Container">
<description>
Download plug-ins from a software site such as a p2 repository or update site.
</description>
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletBundleContainer.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletBundleContainer.java
index bf39c2bf79..cd150a87ed 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletBundleContainer.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletBundleContainer.java
@@ -34,6 +34,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.engine.Phase;
import org.eclipse.equinox.internal.p2.engine.PhaseSet;
@@ -52,8 +53,10 @@ import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IProvidedCapability;
+import org.eclipse.equinox.p2.metadata.IRequirement;
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.planner.IPlanner;
import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
@@ -120,8 +123,19 @@ public class TargletBundleContainer extends AbstractBundleContainer
private static final String FEATURE_SUFFIX = ".feature.group";
+ private static final String SOURCE_IU_ID = "org.eclipse.emf.cdo.releng.targlet.source.bundles"; //$NON-NLS-1$
+
+ private static final IRequirement BUNDLE_REQUIREMENT = MetadataFactory.createRequirement(
+ "org.eclipse.equinox.p2.eclipse.type", "bundle", null, null, false, false, false); //$NON-NLS-1$ //$NON-NLS-2$
+
private static final byte[] BUFFER = new byte[8192];
+ private static final String PROP_ARCH = "osgi.arch"; //$NON-NLS-1$
+
+ private static final String PROP_OS = "osgi.os"; //$NON-NLS-1$
+
+ private static final String PROP_WS = "osgi.ws"; //$NON-NLS-1$
+
private static final String TRUE = Boolean.TRUE.toString();
private static final String FALSE = Boolean.FALSE.toString();
@@ -182,17 +196,96 @@ public class TargletBundleContainer extends AbstractBundleContainer
}
}
- public String getDigest()
+ public boolean isIncludeSources()
+ {
+ for (Targlet targlet : targlets)
+ {
+ if (targlet.isIncludeSources())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public boolean isIncludeAllPlatforms()
+ {
+ for (Targlet targlet : targlets)
+ {
+ if (targlet.isIncludeAllPlatforms())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public String getEnvironmentProperties()
+ {
+ StringBuilder builder = new StringBuilder();
+ String ws = target.getWS();
+ if (ws == null)
+ {
+ ws = Platform.getWS();
+ }
+
+ builder.append(PROP_WS);
+ builder.append("="); //$NON-NLS-1$
+ builder.append(ws);
+ builder.append(","); //$NON-NLS-1$
+ String os = target.getOS();
+ if (os == null)
+ {
+ os = Platform.getOS();
+ }
+
+ builder.append(PROP_OS);
+ builder.append("="); //$NON-NLS-1$
+ builder.append(os);
+ builder.append(","); //$NON-NLS-1$
+ String arch = target.getArch();
+ if (arch == null)
+ {
+ arch = Platform.getOSArch();
+ }
+
+ builder.append(PROP_ARCH);
+ builder.append("="); //$NON-NLS-1$
+ builder.append(arch);
+ return builder.toString();
+ }
+
+ public String getNLProperty()
+ {
+ String nl = target.getNL();
+ if (nl == null)
+ {
+ nl = Platform.getNL();
+ }
+
+ return nl;
+ }
+
+ public String getDigest() throws ProvisionException
{
if (digest == null)
{
- String xml = serialize();
InputStream stream = null;
try
{
+ Writer writer = Persistence.toXML(targlets);
+ writer.write("\n<!-- Environment Properties: ");
+ writer.write(getEnvironmentProperties());
+ writer.write(" -->");
+ writer.write("\n<!-- NL Property: ");
+ writer.write(getNLProperty());
+ writer.write(" -->\n");
+
final MessageDigest digest = MessageDigest.getInstance("SHA-1");
- stream = new FilterInputStream(new ByteArrayInputStream(xml.getBytes("UTF-8")))
+ stream = new FilterInputStream(new ByteArrayInputStream(writer.toString().getBytes("UTF-8")))
{
@Override
public int read() throws IOException
@@ -298,193 +391,251 @@ public class TargletBundleContainer extends AbstractBundleContainer
return TargletProfileManager.POOL_FOLDER.getAbsolutePath();
}
+ @Override
+ protected void associateWithTarget(ITargetDefinition target)
+ {
+ super.associateWithTarget(target);
+ this.target = target;
+
+ }
+
public void updateProfile(IProgressMonitor monitor) throws ProvisionException
{
- initProfile();
+ initProfile(monitor);
- List<InstallableUnit> roots = new ArrayList<InstallableUnit>();
- for (Targlet targlet : targlets)
+ try
{
- for (InstallableUnit root : targlet.getRoots())
+ List<InstallableUnit> roots = new ArrayList<InstallableUnit>();
+ for (Targlet targlet : targlets)
{
- roots.add(root);
+ for (InstallableUnit root : targlet.getRoots())
+ {
+ roots.add(root);
+ }
}
- }
- if (roots.isEmpty())
- {
- return;
- }
-
- final IUAnalyzer analyzer = new IUAnalyzer();
- final Map<IInstallableUnit, File> sources = new HashMap<IInstallableUnit, File>();
- List<URI> uris = new ArrayList<URI>();
-
- for (Targlet targlet : targlets)
- {
- for (AutomaticSourceLocator sourceLocator : targlet.getSourceLocators())
+ if (roots.isEmpty())
{
- boolean locateNestedProjects = sourceLocator.isLocateNestedProjects();
- File rootFolder = new File(sourceLocator.getRootFolder());
-
- Map<IInstallableUnit, File> ius = analyzer.analyze(rootFolder, locateNestedProjects, monitor);
- sources.putAll(ius);
+ return;
}
- for (P2Repository p2Repository : targlet.getActiveP2Repositories())
+ final IUAnalyzer analyzer = new IUAnalyzer();
+ final Map<IInstallableUnit, File> sources = new HashMap<IInstallableUnit, File>();
+ List<URI> uris = new ArrayList<URI>();
+
+ for (Targlet targlet : targlets)
{
- try
+ for (AutomaticSourceLocator sourceLocator : targlet.getSourceLocators())
{
- URI uri = new URI(p2Repository.getURL());
- uris.add(uri);
+ boolean locateNestedProjects = sourceLocator.isLocateNestedProjects();
+ File rootFolder = new File(sourceLocator.getRootFolder());
+
+ Map<IInstallableUnit, File> ius = analyzer.analyze(rootFolder, locateNestedProjects, monitor);
+ sources.putAll(ius);
}
- catch (URISyntaxException ex)
+
+ for (P2Repository p2Repository : targlet.getActiveP2Repositories())
{
- throw new ProvisionException(ex.getMessage(), ex);
+ try
+ {
+ URI uri = new URI(p2Repository.getURL());
+ uris.add(uri);
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new ProvisionException(ex.getMessage(), ex);
+ }
}
}
- }
-
- IProvisioningAgent agent = TargletProfileManager.getInstance().getAgent();
- IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager)agent
- .getService(IMetadataRepositoryManager.SERVICE_NAME);
- IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager)agent
- .getService(IArtifactRepositoryManager.SERVICE_NAME);
+ IProvisioningAgent agent = TargletProfileManager.getInstance().getAgent();
- for (URI uri : uris)
- {
- metadataManager.addRepository(uri);
- artifactManager.addRepository(uri);
- }
+ IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager)agent
+ .getService(IMetadataRepositoryManager.SERVICE_NAME);
+ IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager)agent
+ .getService(IArtifactRepositoryManager.SERVICE_NAME);
- ProvisioningContext context = new ProvisioningContext(agent)
- {
- private CollectionResult<IInstallableUnit> result;
+ for (URI uri : uris)
+ {
+ metadataManager.addRepository(uri);
+ artifactManager.addRepository(uri);
+ }
- @Override
- public IQueryable<IInstallableUnit> getMetadata(IProgressMonitor monitor)
+ ProvisioningContext context = new ProvisioningContext(agent)
{
- if (result == null)
+ private CollectionResult<IInstallableUnit> result;
+
+ @Override
+ public IQueryable<IInstallableUnit> getMetadata(IProgressMonitor monitor)
{
- List<IInstallableUnit> ius = new ArrayList<IInstallableUnit>();
- Set<String> ids = analyzer.getIDs();
- prepareSources(ius, ids);
+ if (result == null)
+ {
+ List<IInstallableUnit> ius = new ArrayList<IInstallableUnit>();
+ Set<String> ids = analyzer.getIDs();
+ prepareSources(ius, ids);
- IQueryable<IInstallableUnit> metadata = super.getMetadata(monitor);
- IQueryResult<IInstallableUnit> metadataResult = metadata.query(QueryUtil.createIUAnyQuery(), monitor);
+ IQueryable<IInstallableUnit> metadata = super.getMetadata(monitor);
+ IQueryResult<IInstallableUnit> metadataResult = metadata.query(QueryUtil.createIUAnyQuery(), monitor);
- for (Iterator<IInstallableUnit> it = metadataResult.iterator(); it.hasNext();)
- {
- IInstallableUnit iu = it.next();
- if (!ids.contains(iu.getId()))
+ for (Iterator<IInstallableUnit> it = metadataResult.iterator(); it.hasNext();)
{
- ius.add(iu);
+ IInstallableUnit iu = it.next();
+ if (!ids.contains(iu.getId()))
+ {
+ ius.add(iu);
+ }
}
+
+ result = new CollectionResult<IInstallableUnit>(ius);
}
- result = new CollectionResult<IInstallableUnit>(ius);
+ return result;
}
- return result;
- }
-
- private void prepareSources(List<IInstallableUnit> ius, Set<String> ids)
- {
- for (IInstallableUnit iu : sources.keySet())
+ private void prepareSources(List<IInstallableUnit> ius, Set<String> ids)
{
- ius.add(iu);
-
- String id = iu.getId();
- String suffix = "";
-
- if (id.endsWith(FEATURE_SUFFIX))
+ for (IInstallableUnit iu : sources.keySet())
{
- id = id.substring(0, id.length() - FEATURE_SUFFIX.length());
- suffix = FEATURE_SUFFIX;
- }
+ ius.add(iu);
- InstallableUnitDescription description = new MetadataFactory.InstallableUnitDescription();
- description.setId(id + ".source" + suffix);
- description.setVersion(iu.getVersion());
+ // TODO Should we create source IUs for source projects only if needed (i.e. required by feature content)?
+ String id = iu.getId();
+ String suffix = "";
- for (Map.Entry<String, String> property : iu.getProperties().entrySet())
- {
- String key = property.getKey();
- String value = property.getValue();
+ if (id.endsWith(FEATURE_SUFFIX))
+ {
+ id = id.substring(0, id.length() - FEATURE_SUFFIX.length());
+ suffix = FEATURE_SUFFIX;
+ }
+
+ InstallableUnitDescription description = new MetadataFactory.InstallableUnitDescription();
+ description.setId(id + ".source" + suffix);
+ description.setVersion(iu.getVersion());
- if ("org.eclipse.equinox.p2.name".equals(key))
+ for (Map.Entry<String, String> property : iu.getProperties().entrySet())
{
- value = "Source for " + value;
+ String key = property.getKey();
+ String value = property.getValue();
+
+ if ("org.eclipse.equinox.p2.name".equals(key))
+ {
+ value = "Source for " + value;
+ }
+
+ description.setProperty(key, value);
}
- description.setProperty(key, value);
+ description.addProvidedCapabilities(Collections.singleton(MetadataFactory.createProvidedCapability(
+ IInstallableUnit.NAMESPACE_IU_ID, description.getId(), description.getVersion())));
+
+ IInstallableUnit sourceIU = MetadataFactory.createInstallableUnit(description);
+ ius.add(sourceIU);
+ ids.add(sourceIU.getId());
}
+ }
+ };
- description.addProvidedCapabilities(Collections.singleton(MetadataFactory.createProvidedCapability(
- IInstallableUnit.NAMESPACE_IU_ID, description.getId(), description.getVersion())));
+ URI[] uriArray = uris.toArray(new URI[uris.size()]);
+ context.setMetadataRepositories(uriArray);
+ context.setArtifactRepositories(uriArray);
+ context.setProperty(ProvisioningContext.FOLLOW_REPOSITORY_REFERENCES, FALSE);
+ context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, FALSE);
- IInstallableUnit sourceIU = MetadataFactory.createInstallableUnit(description);
- ius.add(sourceIU);
- ids.add(sourceIU.getId());
- }
+ Version sourceIUVersion = getSourceIUVersion();
+
+ IPlanner planner = (IPlanner)agent.getService(IPlanner.SERVICE_NAME);
+ if (planner == null)
+ {
+ throw new ProvisionException("Planner could not be loaded");
}
- };
- URI[] uriArray = uris.toArray(new URI[uris.size()]);
- context.setMetadataRepositories(uriArray);
- context.setArtifactRepositories(uriArray);
- context.setProperty(ProvisioningContext.FOLLOW_REPOSITORY_REFERENCES, FALSE);
- context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, FALSE);
+ IProfileChangeRequest request = planner.createChangeRequest(profile);
+ IQuery<IInstallableUnit> query = new IUProfilePropertyQuery(IProfile.PROP_PROFILE_ROOT_IU, TRUE);
+ IQueryResult<IInstallableUnit> installedIUs = profile.query(query, new ProgressMonitor());
+ request.removeAll(installedIUs.toUnmodifiableSet());
- IPlanner planner = (IPlanner)agent.getService(IPlanner.SERVICE_NAME);
- if (planner == null)
- {
- throw new ProvisionException("Planner could not be loaded");
- }
+ IQueryable<IInstallableUnit> metadata = context.getMetadata(monitor);
+ for (InstallableUnit root : roots)
+ {
+ IQuery<IInstallableUnit> iuQuery = QueryUtil.createIUQuery(root.getID(), root.getVersionRange());
+ IQuery<IInstallableUnit> latestQuery = QueryUtil.createLatestQuery(iuQuery);
- IProfileChangeRequest request = planner.createChangeRequest(profile);
- IQuery<IInstallableUnit> query = new IUProfilePropertyQuery(IProfile.PROP_PROFILE_ROOT_IU, TRUE);
- IQueryResult<IInstallableUnit> installedIUs = profile.query(query, new ProgressMonitor());
- request.removeAll(installedIUs.toUnmodifiableSet());
+ for (IInstallableUnit iu : metadata.query(latestQuery, new ProgressMonitor()))
+ {
+ request.setInstallableUnitProfileProperty(iu, IProfile.PROP_PROFILE_ROOT_IU, TRUE);
+ request.add(iu);
+ }
+ }
- IQueryable<IInstallableUnit> metadata = context.getMetadata(monitor);
- for (InstallableUnit root : roots)
- {
- IQuery<IInstallableUnit> iuQuery = QueryUtil.createIUQuery(root.getID(), root.getVersionRange());
- IQuery<IInstallableUnit> latestQuery = QueryUtil.createLatestQuery(iuQuery);
+ planAndInstall(agent, context, planner, request);
- for (IInstallableUnit iu : metadata.query(latestQuery, new ProgressMonitor()))
+ if (isIncludeSources())
{
- request.setInstallableUnitProfileProperty(iu, IProfile.PROP_PROFILE_ROOT_IU, TRUE);
- request.add(iu);
+ IInstallableUnit iu = generateSourceIU(sourceIUVersion);
+
+ IProfileChangeRequest sourceRequest = planner.createChangeRequest(profile);
+ sourceRequest.setInstallableUnitProfileProperty(iu, IProfile.PROP_PROFILE_ROOT_IU, TRUE);
+ sourceRequest.add(iu);
+
+ planAndInstall(agent, context, planner, sourceRequest);
}
- }
- IProvisioningPlan plan = planner.getProvisioningPlan(request, context, new ProgressMonitor());
- if (!plan.getStatus().isOK())
+ updateWorkspace(sources, new ProgressMonitor());
+ profileNeedsUpdate.set(false);
+ }
+ catch (Throwable t)
{
- throw new ProvisionException(plan.getStatus());
+ profileNeedsUpdate.set(true);
+ // TODO Handle update problems, e.g. "return" to last working profile
}
+ }
- IEngine engine = (IEngine)agent.getService(IEngine.SERVICE_NAME);
- if (engine == null)
+ private Version getSourceIUVersion()
+ {
+ IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(SOURCE_IU_ID);
+ IQueryResult<IInstallableUnit> result = profile.query(query, null);
+ if (!result.isEmpty())
{
- throw new ProvisionException("Engine could not be loaded");
+ IInstallableUnit currentSourceIU = result.iterator().next();
+ Integer major = (Integer)currentSourceIU.getVersion().getSegment(0);
+ return Version.createOSGi(major.intValue() + 1, 0, 0);
}
- IPhaseSet phaseSet = createPhaseSet();
- IStatus status = PlanExecutionHelper.executePlan(plan, engine, phaseSet, context, new ProgressMonitor());
- if (!status.isOK())
+ return Version.createOSGi(1, 0, 0);
+ }
+
+ private IInstallableUnit generateSourceIU(Version sourceIUVersion)
+ {
+ // Create and return an IU that has optional and greedy requirements on all source bundles
+ // related to bundle IUs in the profile
+ ArrayList<IRequirement> requirements = new ArrayList<IRequirement>();
+
+ IQueryResult<IInstallableUnit> profileIUs = profile.query(QueryUtil.createIUAnyQuery(), null);
+ for (Iterator<IInstallableUnit> i = profileIUs.iterator(); i.hasNext();)
{
- throw new ProvisionException(status);
+ IInstallableUnit profileIU = i.next();
+
+ // TODO What about source features?
+ if (profileIU.satisfies(BUNDLE_REQUIREMENT))
+ {
+ String id = profileIU.getId() + ".source"; //$NON-NLS-1$
+ Version version = profileIU.getVersion();
+
+ IRequirement sourceRequirement = MetadataFactory.createRequirement(
+ "osgi.bundle", id, new VersionRange(version, true, version, true), null, true, false, true); //$NON-NLS-1$
+ requirements.add(sourceRequirement);
+ }
}
- updateWorkspace(sources, new ProgressMonitor());
- profileNeedsUpdate.set(false);
+ InstallableUnitDescription sourceIUDescription = new MetadataFactory.InstallableUnitDescription();
+ sourceIUDescription.setSingleton(true);
+ sourceIUDescription.setId(SOURCE_IU_ID);
+ sourceIUDescription.setVersion(sourceIUVersion);
+ sourceIUDescription.addRequirements(requirements);
+ sourceIUDescription.setCapabilities(new IProvidedCapability[] { MetadataFactory.createProvidedCapability(
+ IInstallableUnit.NAMESPACE_IU_ID, SOURCE_IU_ID, sourceIUVersion) });
- // return new Status(IStatus.OK, PDECore.PLUGIN_ID, ITargetLocationUpdater.STATUS_CODE_NO_CHANGE,
- // "Targlet container update completed successfully", null);
+ return MetadataFactory.createInstallableUnit(sourceIUDescription);
}
private void updateWorkspace(final Map<IInstallableUnit, File> sources, IProgressMonitor monitor)
@@ -502,7 +653,7 @@ public class TargletBundleContainer extends AbstractBundleContainer
DocumentBuilder documentBuilder = XMLUtil.createDocumentBuilder();
IWorkspaceRoot root = workspace.getRoot();
- // plan.getAdditions() would probably also do and be cheaper
+ // TODO plan.getAdditions() would probably also do and be cheaper
IQueryResult<IInstallableUnit> result = profile.query(QueryUtil.createIUAnyQuery(), monitor);
for (IInstallableUnit iu : result.toUnmodifiableSet())
{
@@ -567,26 +718,11 @@ public class TargletBundleContainer extends AbstractBundleContainer
}
}
- @Override
- protected TargetBundle[] resolveBundles(ITargetDefinition target, IProgressMonitor monitor) throws CoreException
- {
- this.target = target;
- resolveUnits(monitor);
- return fBundles;
- }
-
- @Override
- protected TargetFeature[] resolveFeatures(ITargetDefinition target, IProgressMonitor monitor) throws CoreException
- {
- // All work has been done in resolveBundles() already
- return fFeatures;
- }
-
private void resolveUnits(IProgressMonitor monitor) throws ProvisionException
{
try
{
- initProfile();
+ initProfile(monitor);
if (profileNeedsUpdate.get())
{
updateProfile(monitor);
@@ -665,17 +801,48 @@ public class TargletBundleContainer extends AbstractBundleContainer
}
}
- private boolean isOSGiBundle(IInstallableUnit unit)
+ @Override
+ protected TargetBundle[] resolveBundles(ITargetDefinition target, IProgressMonitor monitor) throws CoreException
+ {
+ // TODO Distribute the progress more evenly between resolveBundles (2/3) and resolveFeatures (1/3)
+ resolveUnits(monitor);
+
+ return fBundles;
+ }
+
+ @Override
+ protected TargetFeature[] resolveFeatures(ITargetDefinition target, IProgressMonitor monitor) throws CoreException
+ {
+ // All work has been done in resolveBundles() already
+ return fFeatures;
+ }
+
+ private void initProfile(IProgressMonitor monitor) throws ProvisionException
+ {
+ if (profile == null)
+ {
+ TargletProfileManager manager = TargletProfileManager.getInstance();
+ profile = manager.getProfile(this, profileNeedsUpdate, monitor);
+ }
+ }
+
+ private void resetProfile()
+ {
+ digest = null;
+ profile = null;
+ }
+
+ private static boolean isOSGiBundle(IInstallableUnit unit)
{
return providesNamespace(unit, "osgi.bundle");
}
- private boolean isFeatureJar(IInstallableUnit unit)
+ private static boolean isFeatureJar(IInstallableUnit unit)
{
return providesNamespace(unit, "org.eclipse.update.feature");
}
- private boolean providesNamespace(IInstallableUnit unit, String namespace)
+ private static boolean providesNamespace(IInstallableUnit unit, String namespace)
{
for (IProvidedCapability providedCapability : unit.getProvidedCapabilities())
{
@@ -688,19 +855,27 @@ public class TargletBundleContainer extends AbstractBundleContainer
return false;
}
- private void initProfile() throws ProvisionException
+ private static void planAndInstall(IProvisioningAgent agent, ProvisioningContext context, IPlanner planner,
+ IProfileChangeRequest request) throws ProvisionException
{
- if (profile == null)
+ IProvisioningPlan plan = planner.getProvisioningPlan(request, context, new ProgressMonitor());
+ if (!plan.getStatus().isOK())
{
- TargletProfileManager manager = TargletProfileManager.getInstance();
- profile = manager.getProfile(this, profileNeedsUpdate);
+ throw new ProvisionException(plan.getStatus());
}
- }
- private void resetProfile()
- {
- digest = null;
- profile = null;
+ IEngine engine = (IEngine)agent.getService(IEngine.SERVICE_NAME);
+ if (engine == null)
+ {
+ throw new ProvisionException("Engine could not be loaded");
+ }
+
+ IPhaseSet phaseSet = createPhaseSet();
+ IStatus status = PlanExecutionHelper.executePlan(plan, engine, phaseSet, context, new ProgressMonitor());
+ if (!status.isOK())
+ {
+ throw new ProvisionException(status);
+ }
}
private static IPhaseSet createPhaseSet()
@@ -777,6 +952,22 @@ public class TargletBundleContainer extends AbstractBundleContainer
}
}
+ // /**
+ // * @author Eike Stepper
+ // */
+ // public static class ProfileDescriptor
+ // {
+ // private List<Targlet> targlets = new ArrayList<Targlet>();
+ //
+ // private String arch;
+ //
+ // private String os;
+ //
+ // private String ws;
+ //
+ // private String nl;
+ // }
+
/**
* @author Eike Stepper
*/
@@ -792,6 +983,10 @@ public class TargletBundleContainer extends AbstractBundleContainer
private static final String TARGLET_ACTIVE_REPOSITORY_LIST = "activeRepositoryList";
+ private static final String TARGLET_INCLUDE_SOURCES = "includeSources";
+
+ private static final String TARGLET_INCLUDE_ALL_PLATFORMS = "includeAllPlatforms";
+
private static final String ROOT = "root";
private static final String ROOT_ID = "id";
@@ -855,6 +1050,9 @@ public class TargletBundleContainer extends AbstractBundleContainer
Targlet targlet = SetupFactory.eINSTANCE.createTarglet();
targlet.setName(targletElement.getAttribute(TARGLET_NAME));
targlet.setActiveRepositoryList(targletElement.getAttribute(TARGLET_ACTIVE_REPOSITORY_LIST));
+ targlet.setIncludeSources(Boolean.valueOf(targletElement.getAttribute(TARGLET_INCLUDE_SOURCES)));
+ targlet.setIncludeAllPlatforms( //
+ Boolean.valueOf(targletElement.getAttribute(TARGLET_INCLUDE_ALL_PLATFORMS)));
container.addTarglet(targlet);
NodeList childNodes = targletElement.getChildNodes();
@@ -926,6 +1124,8 @@ public class TargletBundleContainer extends AbstractBundleContainer
Element targletElement = document.createElement(TARGLET);
targletElement.setAttribute(TARGLET_NAME, targlet.getName());
targletElement.setAttribute(TARGLET_ACTIVE_REPOSITORY_LIST, targlet.getActiveRepositoryList());
+ targletElement.setAttribute(TARGLET_INCLUDE_SOURCES, Boolean.toString(targlet.isIncludeSources()));
+ targletElement.setAttribute(TARGLET_INCLUDE_ALL_PLATFORMS, Boolean.toString(targlet.isIncludeAllPlatforms()));
containerElement.appendChild(targletElement);
for (InstallableUnit root : targlet.getRoots())
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletProfileManager.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletProfileManager.java
index 53a9ee58cd..6ce31d8ee6 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletProfileManager.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TargletProfileManager.java
@@ -19,10 +19,8 @@ import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.net4j.util.io.IOUtil;
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.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
@@ -70,12 +68,6 @@ public final class TargletProfileManager
private static final String PROP_TARGLET_CONTAINER_DIGEST = "targlet.container.digest"; //$NON-NLS-1$
- private static final String PROP_ARCH = "osgi.arch"; //$NON-NLS-1$
-
- private static final String PROP_OS = "osgi.os"; //$NON-NLS-1$
-
- private static final String PROP_WS = "osgi.ws"; //$NON-NLS-1$
-
private static final String WORKSPACE_RELATIVE_PROPERTIES = ".metadata/.plugins/" + Activator.PLUGIN_ID //$NON-NLS-1$
+ "/targlet-container.properties"; //$NON-NLS-1$
@@ -93,8 +85,6 @@ public final class TargletProfileManager
private IProfileRegistry profileRegistry;
- private HashBag<String> digests;
-
private TargletProfileManager() throws ProvisionException
{
BundleContext context = Activator.getBundleContext();
@@ -172,8 +162,8 @@ public final class TargletProfileManager
return agent;
}
- public synchronized IProfile getProfile(TargletBundleContainer container, AtomicBoolean needsUpdate)
- throws ProvisionException
+ public synchronized IProfile getProfile(TargletBundleContainer container, AtomicBoolean needsUpdate,
+ IProgressMonitor monitor) throws ProvisionException
{
waitUntilInitialized();
@@ -186,15 +176,14 @@ public final class TargletProfileManager
Map<String, String> properties = new HashMap<String, String>();
properties.put(PROP_TARGLET_CONTAINER_WORKSPACE, WORKSPACE_LOCATION);
properties.put(PROP_TARGLET_CONTAINER_DIGEST, digest);
+ properties.put(IProfile.PROP_ENVIRONMENTS, container.getEnvironmentProperties());
+ properties.put(IProfile.PROP_NL, container.getNLProperty());
properties.put(IProfile.PROP_CACHE, POOL_FOLDER.getAbsolutePath());
properties.put(IProfile.PROP_INSTALL_FEATURES, Boolean.TRUE.toString());
- properties.put(IProfile.PROP_ENVIRONMENTS, generateEnvironmentProperties(container.getTarget()));
- properties.put(IProfile.PROP_NL, generateNLProperty(container.getTarget()));
profile = profileRegistry.addProfile(profileID, properties);
- digests.add(digest);
- writeDigests(WORKSPACE_PROPERTIES_FILE, digests);
+ initialize(monitor);
}
if (needsUpdate != null)
@@ -206,15 +195,15 @@ public final class TargletProfileManager
return profile;
}
- private void initialize(IProgressMonitor monitor) throws Exception
+ private void initialize(IProgressMonitor monitor) throws ProvisionException
{
- collectDigests(monitor);
- removeGarbageProfiles();
+ HashBag<String> currentDigests = collectCurrentDigests(monitor);
+ removeGarbageProfiles(currentDigests);
}
- private void collectDigests(IProgressMonitor monitor) throws CoreException
+ private HashBag<String> collectCurrentDigests(IProgressMonitor monitor) throws ProvisionException
{
- digests = new HashBag<String>();
+ HashBag<String> digests = new HashBag<String>();
@SuppressWarnings("restriction")
ITargetPlatformService targetService = (ITargetPlatformService)org.eclipse.pde.internal.core.PDECore.getDefault()
@@ -222,25 +211,33 @@ public final class TargletProfileManager
for (ITargetHandle targetHandle : targetService.getTargets(monitor))
{
- ITargetDefinition definition = targetHandle.getTargetDefinition();
- for (ITargetLocation targetLocation : definition.getTargetLocations())
+ try
{
- if (targetLocation instanceof TargletBundleContainer)
+ ITargetDefinition definition = targetHandle.getTargetDefinition();
+ for (ITargetLocation targetLocation : definition.getTargetLocations())
{
- TargletBundleContainer targletContainer = (TargletBundleContainer)targetLocation;
- String digest = targletContainer.getDigest();
- digests.add(digest);
+ if (targetLocation instanceof TargletBundleContainer)
+ {
+ TargletBundleContainer targletContainer = (TargletBundleContainer)targetLocation;
+ String digest = targletContainer.getDigest();
+ digests.add(digest);
+ }
}
}
+ catch (Exception ex)
+ {
+ throwProvisionException(ex);
+ }
}
writeDigests(WORKSPACE_PROPERTIES_FILE, digests);
+ return digests;
}
- private void removeGarbageProfiles()
+ private void removeGarbageProfiles(HashBag<String> currentDigests)
{
Map<String, HashBag<String>> workspaces = new HashMap<String, HashBag<String>>();
- workspaces.put(WORKSPACE_LOCATION, digests);
+ workspaces.put(WORKSPACE_LOCATION, currentDigests);
for (IProfile profile : profileRegistry.getProfiles())
{
@@ -294,52 +291,6 @@ public final class TargletProfileManager
}
}
- private static String generateEnvironmentProperties(ITargetDefinition target)
- {
- StringBuilder builder = new StringBuilder();
- String ws = target.getWS();
- if (ws == null)
- {
- ws = Platform.getWS();
- }
-
- builder.append(PROP_WS);
- builder.append("="); //$NON-NLS-1$
- builder.append(ws);
- builder.append(","); //$NON-NLS-1$
- String os = target.getOS();
- if (os == null)
- {
- os = Platform.getOS();
- }
-
- builder.append(PROP_OS);
- builder.append("="); //$NON-NLS-1$
- builder.append(os);
- builder.append(","); //$NON-NLS-1$
- String arch = target.getArch();
- if (arch == null)
- {
- arch = Platform.getOSArch();
- }
-
- builder.append(PROP_ARCH);
- builder.append("="); //$NON-NLS-1$
- builder.append(arch);
- return builder.toString();
- }
-
- private static String generateNLProperty(ITargetDefinition target)
- {
- String nl = target.getNL();
- if (nl == null)
- {
- nl = Platform.getNL();
- }
-
- return nl;
- }
-
private static void writeDigests(File file, HashBag<String> digests)
{
file.getParentFile().mkdirs();
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TestAction.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TestAction.java
index 32366715f5..b4aa62d9a7 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TestAction.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/targlets/TestAction.java
@@ -120,6 +120,7 @@ public class TestAction implements IWorkbenchWindowActionDelegate
Targlet targlet = SetupFactory.eINSTANCE.createTarglet();
targlet.setName("EMF");
+ targlet.setIncludeSources(true);
EList<InstallableUnit> roots = targlet.getRoots();
roots.add(component("org.eclipse.emf.cdo.site.feature.group"));
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 2c1024148c..18b4647e62 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
@@ -2203,13 +2203,31 @@ public interface SetupPackage extends EPackage
int TARGLET_TASK__ACTIVE_P2_REPOSITORIES = SETUP_TASK_FEATURE_COUNT + 5;
/**
+ * The feature id for the '<em><b>Include Sources</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TARGLET_TASK__INCLUDE_SOURCES = SETUP_TASK_FEATURE_COUNT + 6;
+
+ /**
+ * The feature id for the '<em><b>Include All Platforms</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TARGLET_TASK__INCLUDE_ALL_PLATFORMS = SETUP_TASK_FEATURE_COUNT + 7;
+
+ /**
* The number of structural features of the '<em>Targlet Task</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int TARGLET_TASK_FEATURE_COUNT = SETUP_TASK_FEATURE_COUNT + 6;
+ int TARGLET_TASK_FEATURE_COUNT = SETUP_TASK_FEATURE_COUNT + 8;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.releng.setup.impl.TargletContainerImpl <em>Targlet Container</em>}' class.
@@ -2304,13 +2322,31 @@ public interface SetupPackage extends EPackage
int TARGLET_DATA__ACTIVE_P2_REPOSITORIES = 5;
/**
+ * The feature id for the '<em><b>Include Sources</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TARGLET_DATA__INCLUDE_SOURCES = 6;
+
+ /**
+ * The feature id for the '<em><b>Include All Platforms</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TARGLET_DATA__INCLUDE_ALL_PLATFORMS = 7;
+
+ /**
* The number of structural features of the '<em>Targlet Data</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int TARGLET_DATA_FEATURE_COUNT = 6;
+ int TARGLET_DATA_FEATURE_COUNT = 8;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2367,6 +2403,24 @@ public interface SetupPackage extends EPackage
int TARGLET__ACTIVE_P2_REPOSITORIES = TARGLET_DATA__ACTIVE_P2_REPOSITORIES;
/**
+ * The feature id for the '<em><b>Include Sources</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TARGLET__INCLUDE_SOURCES = TARGLET_DATA__INCLUDE_SOURCES;
+
+ /**
+ * The feature id for the '<em><b>Include All Platforms</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TARGLET__INCLUDE_ALL_PLATFORMS = TARGLET_DATA__INCLUDE_ALL_PLATFORMS;
+
+ /**
* The number of structural features of the '<em>Targlet</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5544,6 +5598,28 @@ public interface SetupPackage extends EPackage
EReference getTargletData_ActiveP2Repositories();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeSources <em>Include Sources</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Include Sources</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeSources()
+ * @see #getTargletData()
+ * @generated
+ */
+ EAttribute getTargletData_IncludeSources();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeAllPlatforms <em>Include All Platforms</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Include All Platforms</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeAllPlatforms()
+ * @see #getTargletData()
+ * @generated
+ */
+ EAttribute getTargletData_IncludeAllPlatforms();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.RepositoryList <em>Repository List</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7452,6 +7528,22 @@ public interface SetupPackage extends EPackage
EReference TARGLET_DATA__ACTIVE_P2_REPOSITORIES = eINSTANCE.getTargletData_ActiveP2Repositories();
/**
+ * The meta object literal for the '<em><b>Include Sources</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute TARGLET_DATA__INCLUDE_SOURCES = eINSTANCE.getTargletData_IncludeSources();
+
+ /**
+ * The meta object literal for the '<em><b>Include All Platforms</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute TARGLET_DATA__INCLUDE_ALL_PLATFORMS = eINSTANCE.getTargletData_IncludeAllPlatforms();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.releng.setup.impl.RepositoryListImpl <em>Repository List</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/TargletData.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/TargletData.java
index 7304651182..16981ab5f3 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/TargletData.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/TargletData.java
@@ -19,6 +19,8 @@ import org.eclipse.emf.ecore.EObject;
* <li>{@link org.eclipse.emf.cdo.releng.setup.TargletData#getRepositoryLists <em>Repository Lists</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.TargletData#getActiveRepositoryList <em>Active Repository List</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.TargletData#getActiveP2Repositories <em>Active P2 Repositories</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeSources <em>Include Sources</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeAllPlatforms <em>Include All Platforms</em>}</li>
* </ul>
* </p>
*
@@ -144,4 +146,56 @@ public interface TargletData extends EObject
*/
EList<P2Repository> getActiveP2Repositories();
+ /**
+ * Returns the value of the '<em><b>Include Sources</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Include Sources</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Include Sources</em>' attribute.
+ * @see #setIncludeSources(boolean)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getTargletData_IncludeSources()
+ * @model
+ * @generated
+ */
+ boolean isIncludeSources();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeSources <em>Include Sources</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Include Sources</em>' attribute.
+ * @see #isIncludeSources()
+ * @generated
+ */
+ void setIncludeSources(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Include All Platforms</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Include All Platforms</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Include All Platforms</em>' attribute.
+ * @see #setIncludeAllPlatforms(boolean)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getTargletData_IncludeAllPlatforms()
+ * @model
+ * @generated
+ */
+ boolean isIncludeAllPlatforms();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.TargletData#isIncludeAllPlatforms <em>Include All Platforms</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Include All Platforms</em>' attribute.
+ * @see #isIncludeAllPlatforms()
+ * @generated
+ */
+ void setIncludeAllPlatforms(boolean value);
+
} // TargletData
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 299c25a7e4..f21b203207 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
@@ -2000,6 +2000,26 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
* <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getTargletData_IncludeSources()
+ {
+ return (EAttribute)targletDataEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getTargletData_IncludeAllPlatforms()
+ {
+ return (EAttribute)targletDataEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getRepositoryList()
{
return repositoryListEClass;
@@ -2850,6 +2870,8 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
createEReference(targletDataEClass, TARGLET_DATA__REPOSITORY_LISTS);
createEAttribute(targletDataEClass, TARGLET_DATA__ACTIVE_REPOSITORY_LIST);
createEReference(targletDataEClass, TARGLET_DATA__ACTIVE_P2_REPOSITORIES);
+ createEAttribute(targletDataEClass, TARGLET_DATA__INCLUDE_SOURCES);
+ createEAttribute(targletDataEClass, TARGLET_DATA__INCLUDE_ALL_PLATFORMS);
repositoryListEClass = createEClass(REPOSITORY_LIST);
createEReference(repositoryListEClass, REPOSITORY_LIST__P2_REPOSITORIES);
@@ -3358,6 +3380,12 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
initEReference(getTargletData_ActiveP2Repositories(), getP2Repository(), null, "activeP2Repositories", null, 0, -1,
TargletData.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEAttribute(getTargletData_IncludeSources(), ecorePackage.getEBoolean(), "includeSources", null, 0, 1,
+ TargletData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+ initEAttribute(getTargletData_IncludeAllPlatforms(), ecorePackage.getEBoolean(), "includeAllPlatforms", null, 0, 1,
+ TargletData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
initEClass(repositoryListEClass, RepositoryList.class, "RepositoryList", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletDataImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletDataImpl.java
index f27e9cbd46..6994bef303 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletDataImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletDataImpl.java
@@ -35,6 +35,8 @@ import java.util.Collection;
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletDataImpl#getRepositoryLists <em>Repository Lists</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletDataImpl#getActiveRepositoryList <em>Active Repository List</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletDataImpl#getActiveP2Repositories <em>Active P2 Repositories</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletDataImpl#isIncludeSources <em>Include Sources</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletDataImpl#isIncludeAllPlatforms <em>Include All Platforms</em>}</li>
* </ul>
* </p>
*
@@ -113,6 +115,46 @@ public abstract class TargletDataImpl extends MinimalEObjectImpl.Container imple
protected String activeRepositoryList = ACTIVE_REPOSITORY_LIST_EDEFAULT;
/**
+ * The default value of the '{@link #isIncludeSources() <em>Include Sources</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeSources()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean INCLUDE_SOURCES_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isIncludeSources() <em>Include Sources</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeSources()
+ * @generated
+ * @ordered
+ */
+ protected boolean includeSources = INCLUDE_SOURCES_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isIncludeAllPlatforms() <em>Include All Platforms</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeAllPlatforms()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean INCLUDE_ALL_PLATFORMS_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isIncludeAllPlatforms() <em>Include All Platforms</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeAllPlatforms()
+ * @generated
+ * @ordered
+ */
+ protected boolean includeAllPlatforms = INCLUDE_ALL_PLATFORMS_EDEFAULT;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -260,6 +302,58 @@ public abstract class TargletDataImpl extends MinimalEObjectImpl.Container imple
* <!-- end-user-doc -->
* @generated
*/
+ public boolean isIncludeSources()
+ {
+ return includeSources;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIncludeSources(boolean newIncludeSources)
+ {
+ boolean oldIncludeSources = includeSources;
+ includeSources = newIncludeSources;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.TARGLET_DATA__INCLUDE_SOURCES,
+ oldIncludeSources, includeSources));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isIncludeAllPlatforms()
+ {
+ return includeAllPlatforms;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIncludeAllPlatforms(boolean newIncludeAllPlatforms)
+ {
+ boolean oldIncludeAllPlatforms = includeAllPlatforms;
+ includeAllPlatforms = newIncludeAllPlatforms;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS,
+ oldIncludeAllPlatforms, includeAllPlatforms));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
@@ -297,6 +391,10 @@ public abstract class TargletDataImpl extends MinimalEObjectImpl.Container imple
return getActiveRepositoryList();
case SetupPackage.TARGLET_DATA__ACTIVE_P2_REPOSITORIES:
return getActiveP2Repositories();
+ case SetupPackage.TARGLET_DATA__INCLUDE_SOURCES:
+ return isIncludeSources();
+ case SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS:
+ return isIncludeAllPlatforms();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -330,6 +428,12 @@ public abstract class TargletDataImpl extends MinimalEObjectImpl.Container imple
case SetupPackage.TARGLET_DATA__ACTIVE_REPOSITORY_LIST:
setActiveRepositoryList((String)newValue);
return;
+ case SetupPackage.TARGLET_DATA__INCLUDE_SOURCES:
+ setIncludeSources((Boolean)newValue);
+ return;
+ case SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS:
+ setIncludeAllPlatforms((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -359,6 +463,12 @@ public abstract class TargletDataImpl extends MinimalEObjectImpl.Container imple
case SetupPackage.TARGLET_DATA__ACTIVE_REPOSITORY_LIST:
setActiveRepositoryList(ACTIVE_REPOSITORY_LIST_EDEFAULT);
return;
+ case SetupPackage.TARGLET_DATA__INCLUDE_SOURCES:
+ setIncludeSources(INCLUDE_SOURCES_EDEFAULT);
+ return;
+ case SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS:
+ setIncludeAllPlatforms(INCLUDE_ALL_PLATFORMS_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -386,6 +496,10 @@ public abstract class TargletDataImpl extends MinimalEObjectImpl.Container imple
.equals(activeRepositoryList);
case SetupPackage.TARGLET_DATA__ACTIVE_P2_REPOSITORIES:
return !getActiveP2Repositories().isEmpty();
+ case SetupPackage.TARGLET_DATA__INCLUDE_SOURCES:
+ return includeSources != INCLUDE_SOURCES_EDEFAULT;
+ case SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS:
+ return includeAllPlatforms != INCLUDE_ALL_PLATFORMS_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -408,6 +522,10 @@ public abstract class TargletDataImpl extends MinimalEObjectImpl.Container imple
result.append(name);
result.append(", activeRepositoryList: ");
result.append(activeRepositoryList);
+ result.append(", includeSources: ");
+ result.append(includeSources);
+ result.append(", includeAllPlatforms: ");
+ result.append(includeAllPlatforms);
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletTaskImpl.java
index 009e1d8cb6..972b397c95 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletTaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/TargletTaskImpl.java
@@ -36,6 +36,8 @@ import java.util.Collection;
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletTaskImpl#getRepositoryLists <em>Repository Lists</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletTaskImpl#getActiveRepositoryList <em>Active Repository List</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletTaskImpl#getActiveP2Repositories <em>Active P2 Repositories</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletTaskImpl#isIncludeSources <em>Include Sources</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.TargletTaskImpl#isIncludeAllPlatforms <em>Include All Platforms</em>}</li>
* </ul>
* </p>
*
@@ -114,6 +116,46 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
protected String activeRepositoryList = ACTIVE_REPOSITORY_LIST_EDEFAULT;
/**
+ * The default value of the '{@link #isIncludeSources() <em>Include Sources</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeSources()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean INCLUDE_SOURCES_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isIncludeSources() <em>Include Sources</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeSources()
+ * @generated
+ * @ordered
+ */
+ protected boolean includeSources = INCLUDE_SOURCES_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isIncludeAllPlatforms() <em>Include All Platforms</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeAllPlatforms()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean INCLUDE_ALL_PLATFORMS_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isIncludeAllPlatforms() <em>Include All Platforms</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIncludeAllPlatforms()
+ * @generated
+ * @ordered
+ */
+ protected boolean includeAllPlatforms = INCLUDE_ALL_PLATFORMS_EDEFAULT;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -261,6 +303,58 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
* <!-- end-user-doc -->
* @generated
*/
+ public boolean isIncludeSources()
+ {
+ return includeSources;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIncludeSources(boolean newIncludeSources)
+ {
+ boolean oldIncludeSources = includeSources;
+ includeSources = newIncludeSources;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.TARGLET_TASK__INCLUDE_SOURCES,
+ oldIncludeSources, includeSources));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isIncludeAllPlatforms()
+ {
+ return includeAllPlatforms;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIncludeAllPlatforms(boolean newIncludeAllPlatforms)
+ {
+ boolean oldIncludeAllPlatforms = includeAllPlatforms;
+ includeAllPlatforms = newIncludeAllPlatforms;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS,
+ oldIncludeAllPlatforms, includeAllPlatforms));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
@@ -298,6 +392,10 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
return getActiveRepositoryList();
case SetupPackage.TARGLET_TASK__ACTIVE_P2_REPOSITORIES:
return getActiveP2Repositories();
+ case SetupPackage.TARGLET_TASK__INCLUDE_SOURCES:
+ return isIncludeSources();
+ case SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS:
+ return isIncludeAllPlatforms();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -331,6 +429,12 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
case SetupPackage.TARGLET_TASK__ACTIVE_REPOSITORY_LIST:
setActiveRepositoryList((String)newValue);
return;
+ case SetupPackage.TARGLET_TASK__INCLUDE_SOURCES:
+ setIncludeSources((Boolean)newValue);
+ return;
+ case SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS:
+ setIncludeAllPlatforms((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -360,6 +464,12 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
case SetupPackage.TARGLET_TASK__ACTIVE_REPOSITORY_LIST:
setActiveRepositoryList(ACTIVE_REPOSITORY_LIST_EDEFAULT);
return;
+ case SetupPackage.TARGLET_TASK__INCLUDE_SOURCES:
+ setIncludeSources(INCLUDE_SOURCES_EDEFAULT);
+ return;
+ case SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS:
+ setIncludeAllPlatforms(INCLUDE_ALL_PLATFORMS_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -387,6 +497,10 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
.equals(activeRepositoryList);
case SetupPackage.TARGLET_TASK__ACTIVE_P2_REPOSITORIES:
return !getActiveP2Repositories().isEmpty();
+ case SetupPackage.TARGLET_TASK__INCLUDE_SOURCES:
+ return includeSources != INCLUDE_SOURCES_EDEFAULT;
+ case SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS:
+ return includeAllPlatforms != INCLUDE_ALL_PLATFORMS_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -415,6 +529,10 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
return SetupPackage.TARGLET_DATA__ACTIVE_REPOSITORY_LIST;
case SetupPackage.TARGLET_TASK__ACTIVE_P2_REPOSITORIES:
return SetupPackage.TARGLET_DATA__ACTIVE_P2_REPOSITORIES;
+ case SetupPackage.TARGLET_TASK__INCLUDE_SOURCES:
+ return SetupPackage.TARGLET_DATA__INCLUDE_SOURCES;
+ case SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS:
+ return SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS;
default:
return -1;
}
@@ -446,6 +564,10 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
return SetupPackage.TARGLET_TASK__ACTIVE_REPOSITORY_LIST;
case SetupPackage.TARGLET_DATA__ACTIVE_P2_REPOSITORIES:
return SetupPackage.TARGLET_TASK__ACTIVE_P2_REPOSITORIES;
+ case SetupPackage.TARGLET_DATA__INCLUDE_SOURCES:
+ return SetupPackage.TARGLET_TASK__INCLUDE_SOURCES;
+ case SetupPackage.TARGLET_DATA__INCLUDE_ALL_PLATFORMS:
+ return SetupPackage.TARGLET_TASK__INCLUDE_ALL_PLATFORMS;
default:
return -1;
}
@@ -471,6 +593,10 @@ public class TargletTaskImpl extends SetupTaskImpl implements TargletTask
result.append(name);
result.append(", activeRepositoryList: ");
result.append(activeRepositoryList);
+ result.append(", includeSources: ");
+ result.append(includeSources);
+ result.append(", includeAllPlatforms: ");
+ result.append(includeAllPlatforms);
result.append(')');
return result.toString();
}

Back to the top