|
|
|
|
|
|
|
Re: Xcore with xtext-maven-plugin: unmapped paths [message #1421480 is a reply to message #1421369] |
Thu, 11 September 2014 12:20 |
|
On 11/09/2014 11:16, Andreas Sewe wrote:
> Hm, I can get this to work for now if I use an explicit
> outputConfiguration:
> <languages>
> <language>
> <setup>org.eclipse.emf.codegen.ecore.xtext.GenModelSupport</setup>
> </language>
> <language>
> <setup>org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup</setup>
> <outputConfigurations>
> <outputConfiguration>
>
> <outputDirectory>target/generated-sources/xcore</outputDirectory>
> </outputConfiguration>
> </outputConfigurations>
> </language>
> </languages> But this kind of defeats the purpose of
> @GenModel(modelDirectory); why do I have to maintain the same
> information twice, once for the IDE and once for Maven? Also, I don't
> see this working anymore as soon as I start using, e.g.,
> @GenModel(editDirectory) in addition to @GenModel(modelDirectory). How
> would it work then?
Hi
I've just answered to another similar post: I'm using a different
approach which works for me:
You can run an mwe2 file from maven (using the fornax plug-in), as you
can see here:
https://github.com/LorenzoBettini/xsemantics/blob/master/plugins/it.xsemantics.dsl/src/it/xsemantics/dsl/GenerateXsemanticsModel.mwe2
Note that this also uses de.itemis.xcore2java.XcoreReader originally
written by Christian (you can find that in the sources of the above
project).
The only thing you need to remember is to put the 1.5 Java compliant
setting in the xcore (see the xcore file in the above project),
otherwise when running the workflow it will not generate type parameters
in the model classes. That specification would be useless in the IDE,
but at least you don't need to maintain duplicate information.
hope this helps
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
Re: Xcore with xtext-maven-plugin: unmapped paths [message #1421524 is a reply to message #1421492] |
Thu, 11 September 2014 13:30 |
|
On 11/09/2014 14:43, Andreas Sewe wrote:
> Hi Lorenzo,
>
> thanks for the suggestion. I was aware of the fornax-maven-plugin but
> not of the XcoreReader. That being said, having to specify a mwe2
> workflow in addition to the build workflow already described in the POM
> doesn't seem easier to me. Why specify the DirectoryCleaner if you have
> the maven-clean-plugin already configured? What's the advantage of using
> the workflow? (Maybe I should read your book to find out ;))
>
> Anyway, to me as a long-time Maven user and short-time Xtext user,
> having a single plugin goal xtext-maven-plugin:generate bound to the
> generate-source phase while leaving everything else to the established
> Maven plugins seems very natural, so I'd really like to stick with that
> plugin for now.
Hi Andreas
(you won't find this detail in the book ;)
I'm not saying there are advantages: it's just that by using the
xtext-maven-plugin I had so many troubles that blocked me, while with
the mwe2 workflow I managed to make it work (not to mention that it's
easier to have a try from the IDE itself by running the workflow; the
DirectoryCleaner is useful when you run it from Eclipse).
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04972 seconds