| Summary: | [Generator] improve generated workflow file | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Alexander Nittka <alex> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | sven.efftinge |
| Version: | 0.7.1 | Keywords: | helpwanted |
| Target Milestone: | M2 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
please provide a patch :-) Fixed in CVS HEAD. Please verify. Closing bug which were set to RESOLVED before Eclipse Neon.0. |
Currently a very minimal workflow file is generated into the MyProject.generator plugin. This is very nice for a first test of the generation process. However, it would be nice to show the user some more of the options (e.g. currently generation is not interrupted if there are errors in the model). Also, it is impossible to use that workflow file when invoking generation from the runtime workspace/some application, as model file, genfolder etc. cannot be passed on. In this respect, I liked the oAW workflow file better. This is why I propose to make the generated workflowfile a bit more complicated again, introducing variables, a conditional workflow component, and making visible some of the important options of the Reader and Generator component. This workflow file could be used in a more general context (by a fragment that adds a generate-Action to the UI) and is also more informative for the user without being too complex. How about the following: <workflow> <property name="genFolder" value="src-gen"/> <property name="modelFile" value="classpath:/model/MyModel.mydsl"/> <property name="doValidate" value="true"/> <property name="doSkipOnErrors" value="true"/> <property name="doCleanDirectory" value="true"/> <property name="fileEncodingToUse" value="MacRoman"/> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".."/> <if cond="${doCleanDirectory}"> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="${genFolder}"/> </if> <component class="org.eclipse.xtext.MweReader" uri="${modelFile}"> <!-- this class will be generated by the xtext generator --> <register class="org.xtext.example.MyDslStandaloneSetup"/> <validate value="${doValidate}"/> </component> <component class="org.eclipse.xpand2.Generator"> <metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/> <fileEncoding value="${fileEncodingToUse}"/> <expand value="templates::Template::main FOR model"/> <genPath value="${genFolder}"/> <skipOnErrors value="${doSkipOnErrors}"/> </component> </workflow>