Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 8765a3629280f09fcca72c90ef15a74a39466b87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
module org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.UMLConnectionPointReference

import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var grammarURI = "classpath:/org/eclipse/papyrus/uml/textedit/connectionpointreference/xtext/UMLConnectionPointReference.xtext"
var file.extensions = "conncectionpointreference"
var projectName = "org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext"
var runtimeProject = "../${projectName}"

Workflow {

	  bean = StandaloneSetup {
    	scanClassPath  = true
		platformUri = "${runtimeProject}/.."
		
		//load EMF ECORE	
		uriMap = {
            from = "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore"
            to = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore"
        }
		
		uriMap = { from = "platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
           		   to = "platform:/resource/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
       	}
        uriMap = {
          from = "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel"
           to = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"
        }
        registerGeneratedEPackage = "org.eclipse.emf.ecore.EcorePackage"
        registerGeneratedEPackage = "org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage"
        registerGenModelFile = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"	
		registerGenModelFile = "platform:/resource/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
		
		//load UML
		
		//Types
       	uriMap = { 
			from = "platform:/plugin/org.eclipse.uml2.types/model/Types.ecore"
           	to = "platform:/resource/org.eclipse.uml2.types/model/Types.ecore"
       	}   	
       	uriMap = { 
			from = "platform:/plugin/org.eclipse.uml2.types/model/Types.genmodel"
           	to = "platform:/resource/org.eclipse.uml2.types/model/Types.genmodel"
       	}
       	
        uriMap = {
            from = "platform:/plugin/org.eclipse.uml2.uml/model/UML.genmodel"
            to = "platform:/resource/org.eclipse.uml2.uml/model/UML.genmodel"
        }
		
 		uriMap = {
            from = "platform:/plugin/org.eclipse.uml2.codegen.ecore/model/GenModel.genmodel"
            to = "platform:/resource/org.eclipse.uml2.codegen.ecore/model/GenModel.genmodel"
        }
        
        uriMap = {
            from = "platform:/plugin/org.eclipse.uml2.codegen.ecore/model/GenModel.ecore"
            to = "platform:/resource/org.eclipse.uml2.codegen.ecore/model/GenModel.ecore"
        }
        uriMap = {
            from = "platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore"
            to = "platform:/resource/org.eclipse.uml2.uml/model/UML.ecore"
        }
		
        registerGeneratedEPackage = "org.eclipse.uml2.uml.UMLPackage"
        registerGeneratedEPackage = "org.eclipse.uml2.codegen.ecore.genmodel.GenModelPackage"
        
	 	registerGenModelFile = "platform:/resource/org.eclipse.uml2.uml/model/UML.genmodel"
        registerGenModelFile = "platform:/resource/org.eclipse.uml2.codegen.ecore/model/GenModel.genmodel"
	}
	component = DirectoryCleaner {
		directory = "${runtimeProject}/src-gen"
	}

	component = DirectoryCleaner {
		directory = "${runtimeProject}.ui/src-gen"
	}

	component = Generator {
		pathRtProject = runtimeProject
		pathUiProject = "${runtimeProject}.ui"
		projectNameRt = projectName
		projectNameUi = "${projectName}.ui"
		language = {
			uri = grammarURI
			fileExtensions = file.extensions

			// Java API to access grammar elements (required by several other fragments)
			fragment = grammarAccess.GrammarAccessFragment {}

			// generates Java API for the generated EPackages 
			fragment = ecore.EcoreGeneratorFragment {
			}
			// Serializer 2.0
			fragment = serializer.SerializerFragment {
           		generateStub = false
           	}

			// a custom ResourceFactory for use with EMF 
			fragment = resourceFactory.ResourceFactoryFragment {
				fileExtensions = file.extensions
			}

			// The antlr parser generator fragment.
			fragment = parser.antlr.XtextAntlrGeneratorFragment {
			//  options = {
			//		backtrack = true
			//	}
			}

			// java-based API for validation 
			fragment = validation.JavaValidatorFragment {
				composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
				composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
				// registerForImportedPackages = true
				inheritImplementation=false
			}

			// scoping and exporting API
			//fragment = scoping.ImportURIScopingFragment {}
			//fragment = exporting.SimpleNamesFragment {}

			// scoping and exporting API 
			 fragment = scoping.ImportNamespacesScopingFragment {}
			fragment = exporting.QualifiedNamesFragment {}
			fragment = builder.BuilderIntegrationFragment {}
			

			 // generator API
            fragment = generator.GeneratorFragment {
                generateMwe = false
                generateJavaMain = false
            }
			// formatter API 
			fragment = formatting.FormatterFragment {}

			// labeling API 
			fragment = labeling.LabelProviderFragment {}

			// outline API 
			fragment = outline.OutlineTreeProviderFragment {}
			fragment = outline.QuickOutlineFragment {}
			
			// quickfix API 
			fragment = quickfix.QuickfixProviderFragment {}

			// content assist API  
			fragment = contentAssist.JavaBasedContentAssistFragment {}

			// the following fragment tries to use the Antlr based content assist 
			//     fragment which can be downloaded from http://www.itemis.com 
			//     and will be ignored if it's not available. 
			// fragment = DelegatingGeneratorFragment { 
			//	delegate = "de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment"
			//	message="You are generating without ANTLR. It is highly recommended to download and use the plugin \'de.itemis.xtext.antlr\' \n\t using the update site http://download.itemis.com/updates/."
			//}

			fragment = parser.antlr.XtextAntlrUiGeneratorFragment {}

			fragment = builder.BuilderIntegrationFragment {}

			// project wizard (optional) 
			/*
			fragment = projectWizard.SimpleProjectWizardFragment {
				generatorProjectName = "${projectName}.generator" 
				modelFileExtension = file.extensions
			}
			*/
			
			// quickfix API 
			fragment = quickfix.QuickfixProviderFragment {}		
		}
	}
}

Back to the top