[581348] Provide support for locating generator models via MANIFEST.MF
registration
diff --git a/.gitignore b/.gitignore
index eed365a..bcb1679 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
*/*/*/target/
**/.oracle_jre_usage
.DS_Store
+**/.tycho-consumer-pom.xml
diff --git a/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/CommonPlugin.java b/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/CommonPlugin.java
index 5c23e91..1e02438 100644
--- a/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/CommonPlugin.java
+++ b/plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/CommonPlugin.java
@@ -32,8 +32,10 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.osgi.service.resolver.BundleDescription;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
+import org.osgi.resource.Capability;
/**
@@ -484,12 +486,14 @@
@Override
public String toString()
{
- return "" + name + "attributes= " + attributes + " children=" + children;
+ return "" + name + " attributes= " + attributes + " children=" + children;
}
}
private static class PDEHelper
{
+ private static final String ECORE_GENERATED_PACKAGE = "org.eclipse.emf.ecore.generated_package";
+
private static final Method PLUGIN_MODEL_BASE_GET_BUNDLE_DESCRIPTION_METHOD;
private static final Method PLUGIN_MODEL_BASE_GET_UNDERLYING_RESOURCE_METHOD;
@@ -504,8 +508,6 @@
private static final Method PLUGIN_REGISTRY_GET_ACTIVE_MODELS_METHOD;
- private static final Method BUNDLE_DESCRIPTION_GET_SYMBOLIC_NAME_METHOD;
-
private static final Method EXTENSIONS_GET_EXTENSIONS_METHOD;
private static final Method PLUGIN_EXTENSION_GET_POINT_METHOD;
@@ -531,7 +533,6 @@
Method pluginModelBaseGetInstallLocationMethod = null;
Method pluginModelBaseGetExtensionsMethod = null;
Method pluginRegistryGetActiveModelsMethod = null;
- Method bundleDescriptionGetSymbolicNameMethod = null;
Method extensionsGetExtensionsMethod = null;
Method pluginExtensionGetPointMethod = null;
Method pluginExtensionGetChildrenMethod = null;
@@ -552,8 +553,6 @@
pluginModelBaseGetExtensionsMethod = pluginModelBaseClass.getMethod("getExtensions");
Class<?> pluginRegistryClass = CommonPlugin.loadClass("org.eclipse.pde.core", "org.eclipse.pde.core.plugin.PluginRegistry");
pluginRegistryGetActiveModelsMethod = pluginRegistryClass.getMethod("getActiveModels", boolean.class);
- Class<?> bundleDescriptionClass = CommonPlugin.loadClass("org.eclipse.pde.core", "org.eclipse.osgi.service.resolver.BundleDescription");
- bundleDescriptionGetSymbolicNameMethod = bundleDescriptionClass.getMethod("getSymbolicName");
Class<?> extensionsClass = CommonPlugin.loadClass("org.eclipse.pde.core", "org.eclipse.pde.core.plugin.IExtensions");
extensionsGetExtensionsMethod = extensionsClass.getMethod("getExtensions");
Class<?> pluginExtensionClass = CommonPlugin.loadClass("org.eclipse.pde.core", "org.eclipse.pde.core.plugin.IPluginExtension");
@@ -578,7 +577,6 @@
PLUGIN_MODEL_BASE_GET_INSTALL_LOCATION_METHOD = pluginModelBaseGetInstallLocationMethod;
PLUGIN_MODEL_BASE_GET_EXTENSIONS_METHOD = pluginModelBaseGetExtensionsMethod;
PLUGIN_REGISTRY_GET_ACTIVE_MODELS_METHOD = pluginRegistryGetActiveModelsMethod;
- BUNDLE_DESCRIPTION_GET_SYMBOLIC_NAME_METHOD = bundleDescriptionGetSymbolicNameMethod;
EXTENSIONS_GET_EXTENSIONS_METHOD = extensionsGetExtensionsMethod;
PLUGIN_EXTENSION_GET_POINT_METHOD = pluginExtensionGetPointMethod;
PLUGIN_EXTENSION_GET_CHILDREN_METHOD = pluginExtensionGetChildrenMethod;
@@ -604,164 +602,107 @@
private static Map<String, URI> computeTargetPlatformBundleMappings()
{
- Map<String, URI> result = new TreeMap<String, URI>();
-
- // Iterate over all the active models in the workspace and target platform.
- //
- // IPluginModelBase[] activeModels = PluginRegistry.getActiveModels(false);
- //
- Object[] activeModels = invoke(null, PLUGIN_REGISTRY_GET_ACTIVE_MODELS_METHOD, Boolean.FALSE);
- for (Object activeModel : activeModels)
- {
- // Determine the symbolic name, underlying resource, if any, and the install location.
- //
- // BundleDescription bundleDescription = activeModel.getBundleDescription();
- // String symbolicName = bundleDescription.getSymbolicName();
- // IResource underlyingResource = activeModel.getUnderlyingResource();
- // String installLocation = activeModel.getInstallLocation();
- //
- Object bundleDescription = invoke(activeModel, PLUGIN_MODEL_BASE_GET_BUNDLE_DESCRIPTION_METHOD);
- String symbolicName = (String)invoke(bundleDescription, BUNDLE_DESCRIPTION_GET_SYMBOLIC_NAME_METHOD);
- Object underlyingResource = invoke(activeModel, PLUGIN_MODEL_BASE_GET_UNDERLYING_RESOURCE_METHOD);
- String installLocation = (String)invoke(activeModel, PLUGIN_MODEL_BASE_GET_INSTALL_LOCATION_METHOD);
-
- // The URI for the location is determined from the underlying resource or the install location, with preference to the former if available.
- //
- URI location;
- if (underlyingResource != null)
+ final Map<String, URI> result = new TreeMap<String, URI>();
+ new ActiveModelVisitor()
{
- // If there is an underlying resource, use the platform resource URI referencing the project in the workspace as the location.
- // underlyingResource.getProject()
- //
- Object project = invoke(underlyingResource, RESOURCE_GET_PROJECT_METHOD);
- IPath fullPath = invoke(project, RESOURCE_GET_FULL_PATH_METHOD);
- location = URI.createPlatformResourceURI(fullPath.toString(), true);
- }
- else if (installLocation != null)
- {
- // Otherwise, the install location in the file system is used...
- //
- File file = new File(installLocation);
- if (file.isDirectory())
+ @Override
+ void visitActiveModel(Object activeModel, BundleDescription bundleDescription, URI location)
{
- // If the file is a directory, create a file URI for that directory.
- //
- location = URI.createFileURI(installLocation);
+ String symbolicName = bundleDescription.getSymbolicName();
+ if (symbolicName != null && location != null)
+ {
+ result.put(symbolicName, location);
+ }
}
- else
- {
- // Otherwise, the location must be an archive, create an archive URI for the file URI of the jar.
- //
- location = URI.createURI("archive:" + URI.createFileURI(installLocation) + "!/");
- }
- }
- else
- {
- location = null;
- }
-
- if (symbolicName != null && location != null)
- {
- result.put(symbolicName, location);
- }
- }
-
+ };
return result;
}
- private static Map<String, List<ElementRecord>> computeModels(Set<String> extensionPoints)
+ private static Map<String, List<ElementRecord>> computeModels(final Set<String> extensionPoints)
{
- Map<String, List<ElementRecord>> result = new TreeMap<String, List<ElementRecord>>();
-
- // Iterate over all the active models in the workspace and target platform.
- //
- // IPluginModelBase[] activeModels = PluginRegistry.getActiveModels(false);
- //
- Object[] activeModels = invoke(null, PLUGIN_REGISTRY_GET_ACTIVE_MODELS_METHOD, Boolean.FALSE);
- for (Object activeModel : activeModels)
- {
- // Iterate over the plugin's extensions...
- //
- // IExtensions extensions = activeModel.getExtensions();
- // IPluginExtension[] pluginExtensions = extensions.getExtensions();
- //
- Object extensions = invoke(activeModel, PLUGIN_MODEL_BASE_GET_EXTENSIONS_METHOD);
- Object[] pluginExtensions = invoke(extensions, EXTENSIONS_GET_EXTENSIONS_METHOD);
- for (Object pluginExtension : pluginExtensions)
+ final Map<String, List<ElementRecord>> result = new TreeMap<String, List<ElementRecord>>();
+ new ActiveModelVisitor()
{
- // String point = pluginExtension.getPoint();
- //
- String point = invoke(pluginExtension, PLUGIN_EXTENSION_GET_POINT_METHOD);
-
- // Process all or the specified extension pointers.
- //
- if (extensionPoints == null || extensionPoints.isEmpty() || extensionPoints.contains(point))
+ @Override
+ void visitActiveModel(Object activeModel, BundleDescription bundleDescription, URI location)
{
- // Determine the symbolic name, underlying resource, if any, and the install location.
- //
- // BundleDescription bundleDescription = activeModel.getBundleDescription();
- // String symbolicName = bundleDescription.getSymbolicName();
- // IResource underlyingResource = activeModel.getUnderlyingResource();
- // String installLocation = activeModel.getInstallLocation();
- //
- Object bundleDescription = invoke(activeModel, PLUGIN_MODEL_BASE_GET_BUNDLE_DESCRIPTION_METHOD);
- String symbolicName = (String)invoke(bundleDescription, BUNDLE_DESCRIPTION_GET_SYMBOLIC_NAME_METHOD);
- Object underlyingResource = invoke(activeModel, PLUGIN_MODEL_BASE_GET_UNDERLYING_RESOURCE_METHOD);
- String installLocation = (String)invoke(activeModel, PLUGIN_MODEL_BASE_GET_INSTALL_LOCATION_METHOD);
+ String symbolicName = bundleDescription.getSymbolicName();
- // The URI for the location is determined from the underlying resource or the install location, with preference to the former if available.
+ // Iterate over the plugin's extensions...
//
- URI location;
- if (underlyingResource != null)
+ // IExtensions extensions = activeModel.getExtensions();
+ // IPluginExtension[] pluginExtensions = extensions.getExtensions();
+ //
+ Object extensions = invoke(activeModel, PLUGIN_MODEL_BASE_GET_EXTENSIONS_METHOD);
+ Object[] pluginExtensions = invoke(extensions, EXTENSIONS_GET_EXTENSIONS_METHOD);
+ if (pluginExtensions.length == 0)
{
- // If there is an underlying resource, use the platform resource URI referencing the project in the workspace as the location.
- // underlyingResource.getProject()
- //
- Object project = invoke(underlyingResource, RESOURCE_GET_PROJECT_METHOD);
- IPath fullPath = invoke(project, RESOURCE_GET_FULL_PATH_METHOD);
- location = URI.createPlatformResourceURI(fullPath.toString(), true);
- }
- else if (installLocation != null)
- {
- // Otherwise, the install location in the file system is used...
- //
- File file = new File(installLocation);
- if (file.isDirectory())
+ if (extensionPoints != null && extensionPoints.contains(ECORE_GENERATED_PACKAGE))
{
- // If the file is a directory, create a file URI for that directory.
- //
- location = URI.createFileURI(installLocation);
- }
- else
- {
- // Otherwise, the location must be an archive, create an archive URI for the file URI of the jar.
- //
- location = URI.createURI("archive:" + URI.createFileURI(installLocation) + "!/");
+ List<Capability> capabilities = bundleDescription.getCapabilities(ECORE_GENERATED_PACKAGE);
+ if (!capabilities.isEmpty())
+ {
+ ElementRecord extensionRecord = new ElementRecord("extension");
+ recordExtensionAttributes(extensionRecord, ECORE_GENERATED_PACKAGE, symbolicName, location);
+
+ for (Capability capability : capabilities)
+ {
+ ElementRecord elementRecord = new ElementRecord("package");
+ Map<String, Object> attributes = capability.getAttributes();
+ elementRecord.attributes.put("uri", "" + attributes.get("uri"));
+ elementRecord.attributes.put("class", "" + attributes.get("class"));
+ elementRecord.attributes.put("genModel", "" + attributes.get("genModel"));
+
+ extensionRecord.children.add(elementRecord);
+ }
+
+ List<ElementRecord> elementRecords = getElementRecords(ECORE_GENERATED_PACKAGE);
+ elementRecords.add(extensionRecord);
+ }
}
}
else
{
- location = null;
- }
+ for (Object pluginExtension : pluginExtensions)
+ {
+ // String point = pluginExtension.getPoint();
+ //
+ String point = invoke(pluginExtension, PLUGIN_EXTENSION_GET_POINT_METHOD);
- List<ElementRecord> elementRecords = result.get(point);
- if (elementRecords == null)
- {
- elementRecords = new ArrayList<ElementRecord>();
- result.put(point, elementRecords);
+ // Process all or the specified extension points.
+ //
+ if (extensionPoints == null || extensionPoints.isEmpty() || extensionPoints.contains(point))
+ {
+ ElementRecord elementRecord = visitElement(pluginExtension);
+ recordExtensionAttributes(elementRecord, point, symbolicName, location);
+ List<ElementRecord> elementRecords = getElementRecords(point);
+ elementRecords.add(elementRecord);
+ }
+ }
}
+ }
- ElementRecord elementRecord = visitElement(pluginExtension);
+ private void recordExtensionAttributes(ElementRecord elementRecord, String point, String symbolicName, URI location)
+ {
if (location != null)
{
elementRecord.attributes.put("point", point);
elementRecord.attributes.put("symbolicName", symbolicName);
elementRecord.attributes.put("location", location.toString());
}
- elementRecords.add(elementRecord);
}
- }
- }
+
+ private List<ElementRecord> getElementRecords(String point)
+ {
+ List<ElementRecord> elementRecords = result.get(point);
+ if (elementRecords == null)
+ {
+ elementRecords = new ArrayList<ElementRecord>();
+ result.put(point, elementRecords);
+ }
+ return elementRecords;
+ }
+ };
// dump(result);
return result;
@@ -825,6 +766,68 @@
return elementRecord;
}
+ private static abstract class ActiveModelVisitor
+ {
+ public ActiveModelVisitor() {
+ // Iterate over all the active models in the workspace and target platform.
+ //
+ // IPluginModelBase[] activeModels = PluginRegistry.getActiveModels(false);
+ //
+ Object[] activeModels = invoke(null, PLUGIN_REGISTRY_GET_ACTIVE_MODELS_METHOD, Boolean.FALSE);
+ for (Object activeModel : activeModels)
+ {
+ // Determine the symbolic name, underlying resource, if any, and the install location.
+ //
+ // BundleDescription bundleDescription = activeModel.getBundleDescription();
+ // IResource underlyingResource = activeModel.getUnderlyingResource();
+ // String installLocation = activeModel.getInstallLocation();
+ //
+ BundleDescription bundleDescription = invoke(activeModel, PLUGIN_MODEL_BASE_GET_BUNDLE_DESCRIPTION_METHOD);
+ Object underlyingResource = invoke(activeModel, PLUGIN_MODEL_BASE_GET_UNDERLYING_RESOURCE_METHOD);
+ String installLocation = (String)invoke(activeModel, PLUGIN_MODEL_BASE_GET_INSTALL_LOCATION_METHOD);
+
+ // The URI for the location is determined from the underlying resource or the install location, with preference to the former if available.
+ //
+ URI location;
+ if (underlyingResource != null)
+ {
+ // If there is an underlying resource, use the platform resource URI referencing the project in the workspace as the location.
+ // underlyingResource.getProject()
+ //
+ Object project = invoke(underlyingResource, RESOURCE_GET_PROJECT_METHOD);
+ IPath fullPath = invoke(project, RESOURCE_GET_FULL_PATH_METHOD);
+ location = URI.createPlatformResourceURI(fullPath.toString(), true);
+ }
+ else if (installLocation != null)
+ {
+ // Otherwise, the install location in the file system is used...
+ //
+ File file = new File(installLocation);
+ if (file.isDirectory())
+ {
+ // If the file is a directory, create a file URI for that directory.
+ //
+ location = URI.createFileURI(installLocation);
+ }
+ else
+ {
+ // Otherwise, the location must be an archive, create an archive URI for the file URI of the jar.
+ //
+ location = URI.createURI("archive:" + URI.createFileURI(installLocation) + "!/");
+ }
+ }
+ else
+ {
+ location = null;
+ }
+
+ visitActiveModel(activeModel, bundleDescription, location);
+ }
+ }
+
+ abstract void visitActiveModel(Object activeModel, BundleDescription bundleDescription, URI location);
+ }
+
// private static void dump(Map<String, List<ElementRecord>> data)
// {
// for (Map.Entry<String, List<ElementRecord>> entry : data.entrySet())
diff --git a/releng/org.eclipse.emf.parent/tp/2018-09.target b/releng/org.eclipse.emf.parent/tp/2018-09.target
index 34a80fd..be51608 100644
--- a/releng/org.eclipse.emf.parent/tp/2018-09.target
+++ b/releng/org.eclipse.emf.parent/tp/2018-09.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2018-12.target b/releng/org.eclipse.emf.parent/tp/2018-12.target
index 432923e..925dac3 100644
--- a/releng/org.eclipse.emf.parent/tp/2018-12.target
+++ b/releng/org.eclipse.emf.parent/tp/2018-12.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2019-03.target b/releng/org.eclipse.emf.parent/tp/2019-03.target
index 12c00cf..eb7251f 100644
--- a/releng/org.eclipse.emf.parent/tp/2019-03.target
+++ b/releng/org.eclipse.emf.parent/tp/2019-03.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2019-06.target b/releng/org.eclipse.emf.parent/tp/2019-06.target
index de812fe..6aeeb8a 100644
--- a/releng/org.eclipse.emf.parent/tp/2019-06.target
+++ b/releng/org.eclipse.emf.parent/tp/2019-06.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2019-09.target b/releng/org.eclipse.emf.parent/tp/2019-09.target
index f5be92a..c3aa39c 100644
--- a/releng/org.eclipse.emf.parent/tp/2019-09.target
+++ b/releng/org.eclipse.emf.parent/tp/2019-09.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2019-12.target b/releng/org.eclipse.emf.parent/tp/2019-12.target
index f79d3e9..6a459f2 100644
--- a/releng/org.eclipse.emf.parent/tp/2019-12.target
+++ b/releng/org.eclipse.emf.parent/tp/2019-12.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2020-03.target b/releng/org.eclipse.emf.parent/tp/2020-03.target
index ca11225..1f88461 100644
--- a/releng/org.eclipse.emf.parent/tp/2020-03.target
+++ b/releng/org.eclipse.emf.parent/tp/2020-03.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2020-06.target b/releng/org.eclipse.emf.parent/tp/2020-06.target
index f8c4217..8c02916 100644
--- a/releng/org.eclipse.emf.parent/tp/2020-06.target
+++ b/releng/org.eclipse.emf.parent/tp/2020-06.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2020-09.target b/releng/org.eclipse.emf.parent/tp/2020-09.target
index e3d9185..b491564 100644
--- a/releng/org.eclipse.emf.parent/tp/2020-09.target
+++ b/releng/org.eclipse.emf.parent/tp/2020-09.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2020-12.target b/releng/org.eclipse.emf.parent/tp/2020-12.target
index dcca06e..7bb7007 100644
--- a/releng/org.eclipse.emf.parent/tp/2020-12.target
+++ b/releng/org.eclipse.emf.parent/tp/2020-12.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2021-03.target b/releng/org.eclipse.emf.parent/tp/2021-03.target
index 40bba4b..6d52823 100644
--- a/releng/org.eclipse.emf.parent/tp/2021-03.target
+++ b/releng/org.eclipse.emf.parent/tp/2021-03.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2021-06.target b/releng/org.eclipse.emf.parent/tp/2021-06.target
index 56f95d1..83a08c3 100644
--- a/releng/org.eclipse.emf.parent/tp/2021-06.target
+++ b/releng/org.eclipse.emf.parent/tp/2021-06.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2021-09.target b/releng/org.eclipse.emf.parent/tp/2021-09.target
index 642bae1..0b6993b 100644
--- a/releng/org.eclipse.emf.parent/tp/2021-09.target
+++ b/releng/org.eclipse.emf.parent/tp/2021-09.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2021-12.target b/releng/org.eclipse.emf.parent/tp/2021-12.target
index e69ec43..4e6d979 100644
--- a/releng/org.eclipse.emf.parent/tp/2021-12.target
+++ b/releng/org.eclipse.emf.parent/tp/2021-12.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2022-03.target b/releng/org.eclipse.emf.parent/tp/2022-03.target
index b55493d..85819f0 100644
--- a/releng/org.eclipse.emf.parent/tp/2022-03.target
+++ b/releng/org.eclipse.emf.parent/tp/2022-03.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2022-06.target b/releng/org.eclipse.emf.parent/tp/2022-06.target
index 05a5866..c61adf1 100644
--- a/releng/org.eclipse.emf.parent/tp/2022-06.target
+++ b/releng/org.eclipse.emf.parent/tp/2022-06.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2022-09.target b/releng/org.eclipse.emf.parent/tp/2022-09.target
index f5736bb..a43934f 100644
--- a/releng/org.eclipse.emf.parent/tp/2022-09.target
+++ b/releng/org.eclipse.emf.parent/tp/2022-09.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2022-12.target b/releng/org.eclipse.emf.parent/tp/2022-12.target
index a1d728f..c433b0f 100644
--- a/releng/org.eclipse.emf.parent/tp/2022-12.target
+++ b/releng/org.eclipse.emf.parent/tp/2022-12.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/2023-03.target b/releng/org.eclipse.emf.parent/tp/2023-03.target
index c317616..d59bc6b 100644
--- a/releng/org.eclipse.emf.parent/tp/2023-03.target
+++ b/releng/org.eclipse.emf.parent/tp/2023-03.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/helios.target b/releng/org.eclipse.emf.parent/tp/helios.target
index e21d9d9..8aa1fa6 100644
--- a/releng/org.eclipse.emf.parent/tp/helios.target
+++ b/releng/org.eclipse.emf.parent/tp/helios.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/indigo.target b/releng/org.eclipse.emf.parent/tp/indigo.target
index 37755a9..7edd8a9 100644
--- a/releng/org.eclipse.emf.parent/tp/indigo.target
+++ b/releng/org.eclipse.emf.parent/tp/indigo.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/juno.target b/releng/org.eclipse.emf.parent/tp/juno.target
index 51e3455..b4f94ab 100644
--- a/releng/org.eclipse.emf.parent/tp/juno.target
+++ b/releng/org.eclipse.emf.parent/tp/juno.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/kepler.target b/releng/org.eclipse.emf.parent/tp/kepler.target
index 54ee33c..d85651a 100644
--- a/releng/org.eclipse.emf.parent/tp/kepler.target
+++ b/releng/org.eclipse.emf.parent/tp/kepler.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/luna.target b/releng/org.eclipse.emf.parent/tp/luna.target
index c6bbf20..bd606ee 100644
--- a/releng/org.eclipse.emf.parent/tp/luna.target
+++ b/releng/org.eclipse.emf.parent/tp/luna.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/mars.target b/releng/org.eclipse.emf.parent/tp/mars.target
index fed8847..2871f9e 100644
--- a/releng/org.eclipse.emf.parent/tp/mars.target
+++ b/releng/org.eclipse.emf.parent/tp/mars.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/neon.target b/releng/org.eclipse.emf.parent/tp/neon.target
index 91748e6..8e321ca 100644
--- a/releng/org.eclipse.emf.parent/tp/neon.target
+++ b/releng/org.eclipse.emf.parent/tp/neon.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/oxygen.target b/releng/org.eclipse.emf.parent/tp/oxygen.target
index 9d735cc..542c47f 100644
--- a/releng/org.eclipse.emf.parent/tp/oxygen.target
+++ b/releng/org.eclipse.emf.parent/tp/oxygen.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/releng/org.eclipse.emf.parent/tp/photon.target b/releng/org.eclipse.emf.parent/tp/photon.target
index 37fecd8..7863ad3 100644
--- a/releng/org.eclipse.emf.parent/tp/photon.target
+++ b/releng/org.eclipse.emf.parent/tp/photon.target
@@ -5,6 +5,7 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.equinox.core.sdk.feature.group" version="0.0.0"/>
<unit id="com.google.appengine.eclipse.sdkbundle" version="0.0.0"/>
<unit id="com.google.gwt.eclipse.sdkbundle" version="0.0.0"/>
diff --git a/tests/org.eclipse.emf.test.core/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.test.core/META-INF/MANIFEST.MF
index b22449d..c05aa82 100644
--- a/tests/org.eclipse.emf.test.core/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.emf.test.core/META-INF/MANIFEST.MF
@@ -28,6 +28,7 @@
org.eclipse.emf.test.core.xrefsopposite.util
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.pde.core;bundle-version="[3.6.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.33.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.change;bundle-version="[2.15.0,3.0.0)",
org.eclipse.emf.ecore.xmi;bundle-version="[2.18.0,3.0.0)";visibility:=reexport,
@@ -37,3 +38,4 @@
Eclipse-LazyStart: true
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.emf.test.core
+Provide-Capability: org.eclipse.emf.ecore.generated_package;uri="http:///org.eclipse.emf.test.models/provide-capability";class="org.eclipse.emf.models.provideCapability.ProvideCapabilityTestPackage";genModel="model/ProvideCapability/ProvideCapability.genmodel"
diff --git a/tests/org.eclipse.emf.test.core/META-INF/p2.inf b/tests/org.eclipse.emf.test.core/META-INF/p2.inf
new file mode 100644
index 0000000..e82dec3
--- /dev/null
+++ b/tests/org.eclipse.emf.test.core/META-INF/p2.inf
@@ -0,0 +1,2 @@
+requires.1.name = org.eclipse.equinox.core.sdk.feature.group
+requires.1.namespace = org.eclipse.equinox.p2.iu
\ No newline at end of file
diff --git a/tests/org.eclipse.emf.test.core/build.properties b/tests/org.eclipse.emf.test.core/build.properties
index 7d3cf0e..d73a7dd 100644
--- a/tests/org.eclipse.emf.test.core/build.properties
+++ b/tests/org.eclipse.emf.test.core/build.properties
@@ -2,7 +2,8 @@
about.html,\
plugin.properties,\
data/,\
- META-INF/
+ META-INF/,\
+ model/
src.includes = about.html, \
Test EMF Core.launch
source.. = src/
diff --git a/tests/org.eclipse.emf.test.core/model/ProvideCapability/ProvideCapability.ecore b/tests/org.eclipse.emf.test.core/model/ProvideCapability/ProvideCapability.ecore
new file mode 100644
index 0000000..ddf37c5
--- /dev/null
+++ b/tests/org.eclipse.emf.test.core/model/ProvideCapability/ProvideCapability.ecore
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="provideCapabilityTest" nsURI="http:///org.eclipse.emf.test.models/provide-capability"
+ nsPrefix="provideCapabilityTest">
+ <eClassifiers xsi:type="ecore:EClass" name="TestProvideCapability"/>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.emf.test.core/model/ProvideCapability/ProvideCapability.genmodel b/tests/org.eclipse.emf.test.core/model/ProvideCapability/ProvideCapability.genmodel
new file mode 100644
index 0000000..74355fd
--- /dev/null
+++ b/tests/org.eclipse.emf.test.core/model/ProvideCapability/ProvideCapability.genmodel
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
+ modelDirectory="" modelPluginID="org.eclipse.emf.test.common" modelName="ProvideCapability"
+ rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="5.0" copyrightFields="false" testsPluginID="org.eclipse.emf.test.common.tests"
+ operationReflection="true" importOrganizing="true">
+ <foreignModel>ProvideCapability.ecore</foreignModel>
+ <genPackages prefix="ProvideCapabilityTest" basePackage="org.eclipse.emf.test.models.provideCapability"
+ disposableProviderFactory="true" ecorePackage="ProvideCapability.ecore#/">
+ <genClasses ecoreClass="ProvideCapability.ecore#//TestProvideCapability"/>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/ecore/EcoreTest.java b/tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/ecore/EcoreTest.java
index 5d63ec5..566785e 100644
--- a/tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/ecore/EcoreTest.java
+++ b/tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/ecore/EcoreTest.java
@@ -22,6 +22,7 @@
import java.util.Map;
import java.util.Map.Entry;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
@@ -40,13 +41,17 @@
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.change.ChangeFactory;
import org.eclipse.emf.ecore.change.ChangePackage;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.EcoreUtil.EqualityHelper;
import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.Version;
public class EcoreTest
{
@@ -394,4 +399,23 @@
Map.Entry<?, ?> badMapEntry = (Entry<?, ?>)ChangeFactory.eINSTANCE.create(ChangePackage.Literals.EOBJECT_TO_CHANGES_MAP_ENTRY);
assertFalse("The dynamic Map.Entry type should check the dynamic type of the instance.", detailsEStructuralFeature.getEType().isInstance(badMapEntry));
}
+
+ @Test
+ public void testProvideCapabilityRegistration()
+ {
+ if (FrameworkUtil.getBundle(Platform.class).getVersion().compareTo(Version.parseVersion("3.26.100")) >=0)
+ {
+ Map<String, URI> ePackageNsURIToGenModelLocationMap = EcorePlugin.getEPackageNsURIToGenModelLocationMap(true);
+ assertTrue(
+ "The nsURI registered by Provide-Capability in the org.eclipse.emf.test.common's MANIFEST.MF should be available",
+ ePackageNsURIToGenModelLocationMap.containsKey("http:///org.eclipse.emf.test.models/provide-capability"));
+ ExtensibleURIConverterImpl uriConverter = new ExtensibleURIConverterImpl();
+ Map<URI, URI> uriMap = uriConverter.getURIMap();
+ uriMap.putAll(EcorePlugin.computePlatformURIMap(true));
+ URI uri = ePackageNsURIToGenModelLocationMap.get("http:///org.eclipse.emf.test.models/provide-capability");
+ assertTrue(
+ "The nsURI registered by Provide-Capability in the org.eclipse.emf.test.common's MANIFEST.MF should refer to an existing GenModel: '" + uri + "'",
+ uriConverter.exists(uri, null));
+ }
+ }
}