Generating with xtend and MWE2 [message #757894] |
Mon, 21 November 2011 08:02  |
Eclipse User |
|
|
|
Hi,
I run my xtend2-based generator as a build participant, but now I need
to run it as a batch process in the Eclipse dev. environment. I guess
using a mwe2 workflow is the obvious solution. I've previously done this
with simple projects, but no I have problems getting the setup to work.
The mwe2 file is as follows:
Workflow {
bean = StandaloneSetup {
scanClassPath = true
registerGeneratedEPackage = "org.eclipse.gmt.emfacade.EmfacadePackage"
registerGenModelFile =
"platform:/resource/org.eclipse.gmt.emfacade/model/emfacade.genmodel"
registerGenModelFile =
"platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel"
registerGenModelFile =
"platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
registerGenModelFile =
"platform:/resource/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel"
}
component = DirectoryCleaner {
directory = "${targetDir}"
}
component = org.eclipse.xtext.mwe.Reader {
// lookup all resources on the classpath
useJavaClassPath = true
// or define search scope explicitly
path = modelPath
// this class will be generated by the xtext generator
register = org.eclipse.gmt.EmfacadeStandaloneSetup {}
uriFilter = org.eclipse.xtext.mwe.NameBasedFilter {
extension = "xef"
}
loadResource = {
slot = "model"
}
}
component = org.eclipse.xtext.generator.GeneratorComponent {
register = org.eclipse.gmt.EmfacadeStandaloneSetup {}
slot = 'model'
outlet = {
path = targetDir
}
}
}
I try to register the relevant EPackages, but I still get the following
error message:
Caused by: org.eclipse.xtext.parser.ParseException:
java.lang.IllegalStateException: Unresolved proxy
platform:/resource/org.eclipse.gmt.emfacade/model/emfacade.ecore#//FacadeModel.
Make sure the EPackage has been registered.
In the model I use namespaces and refer to both ecore and genmodel files
on the classpath. Will this work as expected with mwe2, i.e. will it
find the relevant model files on the classpath, or do I somehow need to
point it to the files that contains the referred to model elements to
include them in the generation process?
Hallvard
|
|
|
|
|
Re: Generating with xtend and MWE2 [message #758160 is a reply to message #758065] |
Tue, 22 November 2011 03:15  |
Eclipse User |
|
|
|
On 21.11.11 21.29, Christian Dietrich wrote:
>
> did you try a registerEcoreFile?
Yes, I tried a couple of combinations of registerGeneratedEPackage,
registerEcoreFile and registerGenModelFile
I've searched for a place where these are described, particularly when
to use each of them, but I haven't found a good explanation. E.g.
- when do I register the EPackage class with registerGeneratedEPackage
and when do I register the ecore file?
- will registering the genmodel file also register the ecore file?
- what about used packages (in this case xbase, jvmtype, genmodel), must
they be (EPackages and/or files) registered separately?
Hallvard
|
|
|
Powered by
FUDForum. Page generated in 0.04690 seconds