Skip to content

Commit

Permalink
Added Capella 6.0.0 target platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
ylussaud committed Dec 13, 2021
1 parent a7f0529 commit 717403e
Show file tree
Hide file tree
Showing 14 changed files with 618 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.emf.common,
org.eclipse.emf.ecore,
org.eclipse.sirius;bundle-version="[5.0.0,6.7.0)",
org.eclipse.sirius;bundle-version="[5.0.0,7.1.0)",
org.obeonetwork.m2doc.genconf,
org.obeonetwork.m2doc,
org.obeonetwork.m2doc.ide
Expand Down
12 changes: 6 additions & 6 deletions plugins/org.obeonetwork.m2doc.sirius/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Bundle-Name: %pluginName
Bundle-SymbolicName: org.obeonetwork.m2doc.sirius;singleton:=true
Bundle-Version: 3.2.1.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.sirius;bundle-version="[5.0.0,6.7.0)",
org.eclipse.sirius.diagram;bundle-version="[5.0.0,6.7.0)",
org.eclipse.sirius;bundle-version="[5.0.0,7.1.0)",
org.eclipse.sirius.diagram;bundle-version="[5.0.0,7.1.0)",
org.eclipse.gmf.runtime.diagram.ui,
org.eclipse.gmf.runtime.diagram.ui.render,
org.eclipse.sirius.diagram.ui;bundle-version="[5.0.0,6.7.0)",
org.eclipse.sirius.ext.base;bundle-version="[5.0.0,6.7.0)",
org.eclipse.sirius.table;bundle-version="[5.0.0,6.7.0)",
org.eclipse.sirius.diagram.ui;bundle-version="[5.0.0,7.1.0)",
org.eclipse.sirius.ext.base;bundle-version="[5.0.0,7.1.0)",
org.eclipse.sirius.table;bundle-version="[5.0.0,7.1.0)",
org.obeonetwork.m2doc;bundle-version="[3.0.0,4.0.0)",
org.obeonetwork.m2doc.genconf;bundle-version="[3.0.0,4.0.0)",
org.eclipse.sirius.common;bundle-version="[5.0.0,6.7.0)",
org.eclipse.sirius.common;bundle-version="[5.0.0,7.1.0)",
org.eclipse.acceleo.query;bundle-version="[5.0.0,8.0.0)",
org.obeonetwork.m2doc.ide;bundle-version="[3.0.0,4.0.0)",
org.eclipse.acceleo.annotations;bundle-version="[5.0.0,8.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.business.api.query.DRepresentationDescriptorQuery;
import org.eclipse.sirius.business.api.query.EObjectQuery;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.diagram.DDiagram;
import org.eclipse.sirius.diagram.business.internal.metamodel.helper.LayerHelper;
Expand All @@ -34,6 +35,10 @@
@SuppressWarnings("restriction")
public final class SiriusRepresentationUtils {

/**
* The getAllLayer() method name.
*/
private static final String GET_ALL_LAYERS = "getAllLayers";
/**
* "Sirius compatibility failed" message.
*/
Expand Down Expand Up @@ -243,15 +248,30 @@ public static List<Layer> getAllLayer(DiagramDescription description) {
final List<Layer> res = new ArrayList<>();

try {
final Method method = DiagramDescription.class.getMethod("getAllLayers");
final Method method = DiagramDescription.class.getMethod(GET_ALL_LAYERS);
res.addAll((List<Layer>) method.invoke(description));
} catch (NoSuchMethodException | SecurityException e) {
try {
final Method method = LayerHelper.class.getMethod("getAllLayers", DiagramDescription.class);
final Method method = LayerHelper.class.getMethod(GET_ALL_LAYERS, DiagramDescription.class);
res.addAll((List<Layer>) method.invoke(null, description));
} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException e1) {
throw new IllegalStateException(SIRIUS_COMPATIBILITY_FAILED, e);
} catch (NoSuchMethodException | SecurityException e1) {
// For Sirius 7.x.x
try {
final Class<?> cls = SiriusRepresentationUtils.class.getClassLoader().loadClass(
"org.eclipse.sirius.diagram.business.api.componentization.DiagramComponentizationManager");
final Object diagramComponentizationManager = cls.getConstructor(new Class<?>[] {}).newInstance();
final Method method = cls.getMethod(GET_ALL_LAYERS, Collection.class, DiagramDescription.class);
final Collection<Viewpoint> selectedViewpoints = new EObjectQuery(description).getSession()
.getSelectedViewpoints(false);
res.addAll((List<Layer>) method.invoke(diagramComponentizationManager, selectedViewpoints,
description));
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException | NoSuchMethodException
| SecurityException e2) {
throw new IllegalStateException(SIRIUS_COMPATIBILITY_FAILED, e2);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e1) {
throw new IllegalStateException(SIRIUS_COMPATIBILITY_FAILED, e1);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new IllegalStateException(SIRIUS_COMPATIBILITY_FAILED, e);
Expand Down
62 changes: 62 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<module>releng/org.obeonetwork.m2doc.targetplatforms/photon</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/oxygen</module>
<!-- Sirius -->
<module>releng/org.obeonetwork.m2doc.targetplatforms/sirius-6.6.0</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/sirius-6.5.1</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/sirius-6.5.0</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/sirius-6.4.x</module>
Expand All @@ -51,6 +52,7 @@
<module>releng/org.obeonetwork.m2doc.targetplatforms/sirius-6.0.0</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/sirius-5.1.1</module>
<!-- Capella -->
<module>releng/org.obeonetwork.m2doc.targetplatforms/capella-6.0.0</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/capella-5.2.0</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/capella-5.1.0</module>
<module>releng/org.obeonetwork.m2doc.targetplatforms/capella-5.0.0</module>
Expand Down Expand Up @@ -872,6 +874,36 @@
</profile>

<!-- Sirius -->
<profile>
<id>platform-sirius-6.6.0</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>platform-version-name</name>
<value>sirius-6.6.0</value>
</property>
</activation>
<properties>
<eclipse-rcptt-inject-site>https://download.eclipse.org/sirius/updates/releases/6.6.0/2020-06</eclipse-rcptt-inject-site>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<target>
<artifact>
<groupId>org.obeonetwork.m2doc</groupId>
<artifactId>m2doc-sirius-6.6.0</artifactId>
<version>3.2.1-SNAPSHOT</version>
</artifact>
</target>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>platform-sirius-6.5.1</id>
<activation>
Expand Down Expand Up @@ -1234,6 +1266,36 @@
</profile>

<!-- Capella -->
<profile>
<id>platform-capella-6.0.0</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>platform-version-name</name>
<value>capella-6.0.0</value>
</property>
</activation>
<properties>
<eclipse-rcptt-inject-site>https://download.eclipse.org/sirius/updates/stable/7.0.0-S20210908-102403/2021-06</eclipse-rcptt-inject-site>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<target>
<artifact>
<groupId>org.obeonetwork.m2doc</groupId>
<artifactId>m2doc-capella-6.0.0</artifactId>
<version>3.2.1-SNAPSHOT</version>
</artifact>
</target>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>platform-capella-5.2.0</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
<target name="M2Doc Capella 5.2.0 Target Platform" sequenceNumber="1639127623">
<target name="M2Doc Capella 5.2.0 Target Platform" sequenceNumber="1639383935">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
Expand Down Expand Up @@ -61,7 +61,7 @@
<unit id="org.eclipse.sirius.aql.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.acceleo.query.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sirius.runtime.ide.ui.acceleo.source.feature.group" version="0.0.0"/>
<repository id="sirius" location="https://download.eclipse.org/sirius/updates/stable/6.6.0-S20211126-081944/2020-06"/>
<repository id="sirius" location="https://download.eclipse.org/sirius/updates/releases/6.6.0/2020-06"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.polarsys.kitalpha.ad.runtime.feature.source.feature.group" version="0.0.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ location eclipse "https://download.eclipse.org/releases/2020-06" {
org.eclipse.pde.feature.group lazy
}

location sirius "https://download.eclipse.org/sirius/updates/stable/6.6.0-S20211126-081944/2020-06" {
location sirius "https://download.eclipse.org/sirius/updates/releases/6.6.0/2020-06" {
org.eclipse.sirius.doc.feature.feature.group lazy
org.eclipse.sirius.doc.feature.source.feature.group lazy
org.eclipse.sirius.runtime.source.feature.group lazy
Expand Down
Loading

0 comments on commit 717403e

Please sign in to comment.