Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2018-03-21 13:28:11 +0000
committerAnsgar Radermacher2018-03-22 08:58:55 +0000
commitb36be92ed00417eeb48f5ed3c77a6d89f1fd2295 (patch)
tree01e88b4a9b01313608263f63abb574604c053777 /plugins/toolsmiths
parentf871cd427884fcfb51cad93cb6a871b03beea2fc (diff)
downloadorg.eclipse.papyrus-b36be92ed00417eeb48f5ed3c77a6d89f1fd2295.tar.gz
org.eclipse.papyrus-b36be92ed00417eeb48f5ed3c77a6d89f1fd2295.tar.xz
org.eclipse.papyrus-b36be92ed00417eeb48f5ed3c77a6d89f1fd2295.zip
Bug 532709 - Generated elementtypeset should have an xmi:id
- add xmi:id to generated elementypeset - add suffix applysterotype in identifier for applysterotype advice - add Apply Stereotype ... in description - set Java 8 as minimal version (required in reality since oxygen) - add Automatic-Module-Name in MANIFEST.MF (required for Java 9 compatibility) Change-Id: Ia7d610c9dcc0bfa7c0b8848fa587fb5e5bab7aca
Diffstat (limited to 'plugins/toolsmiths')
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.classpath2
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/META-INF/MANIFEST.MF3
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/pom.xml3
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java8
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend8
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend3
7 files changed, 20 insertions, 13 deletions
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.classpath b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.classpath
index 3e8bd41bf6b..00a2ad155bb 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.classpath
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="xtend-gen"/>
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.settings/org.eclipse.jdt.core.prefs b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.settings/org.eclipse.jdt.core.prefs
index f08be2b06c4..b3aa6d60f94 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/META-INF/MANIFEST.MF b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/META-INF/MANIFEST.MF
index 6b6956769b4..525cced83b8 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/META-INF/MANIFEST.MF
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/META-INF/MANIFEST.MF
@@ -15,4 +15,5 @@ Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.profile.types.generator.internal.Activator
Bundle-Description: %pluginDescription
Bundle-SymbolicName: org.eclipse.papyrus.uml.profile.types.generator;singleton:=true
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.papyrus.uml.profile.types.generator
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/pom.xml b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/pom.xml
index 230442e40f5..bce3f879faf 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/pom.xml
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/pom.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.papyrus</groupId>
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java
index 3566d4242ef..aae436c4ead 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java
@@ -104,13 +104,17 @@ public abstract class AbstractGenerator<I extends EObject, O extends EObject> {
try {
Resource output = resourceSet.createResource(outputURI);
-
result = generate(input, output.getContents());
// use Identifier as XML-ID. This implies that the same XML-ID is used when re-generating
EObject set = output.getContents().size() > 0 ? output.getContents().get(0) : null;
if (set instanceof ElementTypeSetConfiguration) {
- for (ElementTypeConfiguration elemTypeConfig : ((ElementTypeSetConfiguration) set).getElementTypeConfigurations()) {
+ ElementTypeSetConfiguration elementTypeSet = (ElementTypeSetConfiguration) set;
+ String elementTypeSetId = elementTypeSet.getIdentifier();
+ if (elementTypeSetId != null && elementTypeSetId.length() > 0) {
+ ((XMLResource) output).setID(elementTypeSet, escapeID(elementTypeSetId));
+ }
+ for (ElementTypeConfiguration elemTypeConfig : elementTypeSet.getElementTypeConfigurations()) {
String id = elemTypeConfig.getIdentifier();
if (id != null && id.length() > 0) {
((XMLResource) output).setID(elemTypeConfig, escapeID(id));
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend
index bd8d1453084..42a000dc237 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend
@@ -16,8 +16,10 @@ package org.eclipse.papyrus.uml.profile.types.generator
import javax.inject.Inject
import javax.inject.Singleton
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration
-import org.eclipse.uml2.uml.Stereotype
+import org.eclipse.papyrus.uml.types.core.advices.applystereotype.ApplyStereotypeAdviceConfiguration
import org.eclipse.papyrus.uml.types.core.advices.applystereotype.ApplyStereotypeAdviceFactory
+import org.eclipse.papyrus.uml.types.core.advices.applystereotype.ApplyStereotypeAdvicePackage
+import org.eclipse.uml2.uml.Stereotype
/**
* Transformation rule for generating an {@link ApplyStereotypeAdviceConfiguration} from a UML {@link Stereotype}.
@@ -33,11 +35,11 @@ class ApplyStereotypeAdviceRule {
def create createApplyStereotypeAdviceConfiguration toAdviceConfiguration(Stereotype umlStereotype,
ImpliedExtension umlExtension, ElementTypeConfiguration supertype) {
- identifier = umlStereotype.name.toFirstLower.qualified + supertype.hintSuffix
+ identifier = umlStereotype.name.toFirstLower.qualified + supertype.hintSuffix +"."+ ApplyStereotypeAdvicePackage.eNAME;
stereotypesToApply.add(umlStereotype.toStereotypeToApply(supertype))
target = umlExtension.toElementType(supertype)
// make file more readable
- description = umlStereotype.name
+ description = "Apply Stereotype "+umlStereotype.name
}
private def create createStereotypeToApply toStereotypeToApply(Stereotype umlStereotype, ElementTypeConfiguration supertype) {
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend
index 967761ec9f9..874556a0e25 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend
@@ -20,10 +20,9 @@ import javax.inject.Singleton
import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration
+import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsFactory
import org.eclipse.uml2.uml.Profile
import org.eclipse.uml2.uml.UMLPackage
-import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsFactory
-import org.eclipse.emf.ecore.xmi.XMLResource
/**
* Transformation rule for generating an {@link ElementTypeSetConfiguration} from a UML {@link Profile}.

Back to the top