|
Re: Generating code from within DSL Editor [message #554127 is a reply to message #554122] |
Fri, 20 August 2010 09:23 |
|
Hi,
zhis is still possible.
the easiest way to try this is to activate the generation of a new project wizard for your dsl in your dsls mwe2
fragment = projectWizard.SimpleProjectWizardFragment {
generatorProjectName = "${projectName}.generator"
modelFileExtension = file.extensions
}
you may have to merge .ui projects plugin.xml and plugin.xml_gen
then you should be able to create a new project in your runtime with a workflow that calls the generator already contained.
Is there something special about the workflow you try to call?
Regards
Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Fri, 20 August 2010 09:35] Report message to a moderator
|
|
|
|
Re: Generating code from within DSL Editor [message #554143 is a reply to message #554122] |
Fri, 20 August 2010 10:02 |
Stefan Missing name Messages: 13 Registered: May 2010 |
Junior Member |
|
|
Thank you both.
There is nothing special about the workflow I'm trying to call, but I figured it would be more convenient to forego the copying of my model from the runtime instance into the generator project.
The generator shall be started manually, not programmatically.
I executed the GenerateMydsl workflow with the projectWizard fragment as you said. From what you're saying I deduce that I now should be able to create a new project with said wizard in my runtime instance. But which wizard do I have to run? There does not seem to be a new one in the wizard overview, at least I cannot find it.
Stefan
[Updated on: Fri, 20 August 2010 10:04] Report message to a moderator
|
|
|
Re: Generating code from within DSL Editor [message #554146 is a reply to message #554143] |
Fri, 20 August 2010 10:09 |
|
Hi,
you find the wizard under
File -> New -> Xtext -> MyDsl Project
but as i said you may have to merge stuff from plugin.xml_gen to plugin.xml (in the .ui project) since Xtext cannot merge plugin xmls.
<extension
point="org.eclipse.ui.newWizards">
<wizard
category="org.eclipse.xtext.projectwiz"
class="org.xtext.example.mydsl.ui.MyDslExecutableExtensionFactory:org.xtext.example.mydsl.ui.wizard.MyDslNewProjectWizard"
icon="icons/editor.gif"
id="org.xtext.example.mydsl.ui.wizard.MyDslNewProjectWizard"
name="MyDsl Project"
project="true">
</wizard>
</extension>
Regards
Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Re: Generating code from within DSL Editor [message #554160 is a reply to message #554122] |
Fri, 20 August 2010 11:24 |
Stefan Missing name Messages: 13 Registered: May 2010 |
Junior Member |
|
|
Thanks again.
I copied the newWizard extension into the plugin.xml and could then create a MydslProject via the wizard. It gave me the following, which looks quite similar to my own try.
module Generator
var targetDir = "src-gen"
var modelPath = "src/model"
Workflow {
component = @workflow.MydslGenerator auto-inject {}
}
Adding a couple of dependencies got me rid of most of the errors it produced, but now I fear I am stuck where I was before. Eclipse tells me:
0 [main] ERROR org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module Generator: Cannot resolve proxy: file:/C:/[...]/mydsl.generator/bin/workflow/MydslGenerator.mwe2#xtextLink_:://@root/@assignment.2/@value/@assignment.2/@value/@assignment.2/@value::http://www.eclipse.org/xtext/common/mwe2/Mwe2<Referrable<0::/1
Full error log, in case it is helpful:
0 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module Generator: Cannot resolve proxy: file:/C:/[...]<a href="/mydsl.generator/bin/workflow/MydslGenerator.mwe2#xtextLink_:://@root/@assignment.2/@value/@assignment.2/@value/@assignment.2/@value::http://www.eclipse.org/xtext/common/mwe2/Mwe2«Referrable«0::/1" target="_blank"> /mydsl.generator/bin/workflow/MydslGenerator.mwe2#xtextLink_ :://@root/@assignment.2/@value/@assignment.2/@value/@assignm ent.2/@value::http://www.eclipse.org/xtext/common/mwe2/Mwe2
java.lang.RuntimeException: Problems instantiating module Generator: Cannot resolve proxy: file:/C:/[...]/mydsl.generator/bin/workflow/MydslGenerator.mwe2#xtextLink_:://@root/@assignment.2/@value/@assignment.2/@value/@assignment.2/@value::http://www.eclipse.org/xtext/common/mwe2/Mwe2<Referrable<0::/1
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: java.lang.IllegalStateException: Cannot resolve proxy: file:/C:/[...]/mydsl.generator/bin/workflow/MydslGenerator.mwe2#xtextLink_:://@root/@assignment.2/@value/@assignment.2/@value/@assignment.2/@value::http://www.eclipse.org/xtext/common/mwe2/Mwe2<Referrable<0::/1
at org.eclipse.xtext.common.types.util.JavaReflectAccess.getRawType(JavaReflectAccess.java:88)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:135)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:126)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:259)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:71)
... 3 more
Stefan
[Updated on: Fri, 20 August 2010 11:29] Report message to a moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03418 seconds