Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Disable generation of validation package from Xcore
Disable generation of validation package from Xcore [message #1710999] Mon, 12 October 2015 09:03 Go to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 313
Registered: July 2009
Senior Member
Hi,

I have project with an XCore model for which the code is automatically
generated (e.g., to emf-gen). For some time now, together with the model
classes, a validation package is created (and a description.txt). How
can I disable that?

In the generated classes, the generated JavaDoc states
"This can be disabled with -vmargs
-Dorg.eclipse.emf.examples.generator.validator=false."

So I added "-vmargs
-Dorg.eclipse.emf.examples.generator.validator=false" to the eclipse.ini
file (actually only the -D.. part in the general -vmargs section -- for
everyone who wants to disable this as well). This helped. But I'm
wondering if there is a possibility to avoid generation of the validator
examples without that explicit (and rather hidden) setting.

The weird thing: My colleagues are using the very same setup (and the
code is shared via git), and on their machines no validation package is
generated even without explicitly avoiding it via the eclipse.ini
setting. We are all using Eclipse Mars and XCore SDK 1.3.1.

Actually, this happens only when the generator is triggered
automatically, e.g., when changing the Xcore file. When I generate the
code explicitly via an MWE script (with The weird thing: My colleagues
are using the very same setup (using the
org.eclipse.xtext.generator.GeneratorComponent component), no validation
package is generated.

I haven't found any settings in the Xcore preferences.

Is it possible to disable the generation in the Xcore file explicitly?
E.g. in the @GenModel (although I haven't found any such field in the
properties view).

Cheers,
Jens
Re: Disable generation of validation package from Xcore [message #1711002 is a reply to message #1710999] Mon, 12 October 2015 09:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jens,

EMF has an example for extending the generator. If you deploy this
example, i.e., if it's installed (which isn't intended) or if it's in
your target platform (also not intended), and your launch config
includes it (that could be accidental) it will simply kick in. I've
included this flag because of course in my runtime launches, the
examples are deployed (so I can test them) but usually I don't want to
do that, so I don't want them to kick in, so I include that option in my
launch config to turn if off.

That's all a long winded way of saying that I think you've installed the
example themselves in your IDE and that people who don't have the
problem haven't done that. Also, it's likely not in your target
platform, so when you launch MWE, it's not present and doesn't kick in.
So best you avoid doing that, uninstalling the examples if necessary.


On 12/10/2015 11:03 AM, Jens v.P. wrote:
> Hi,
>
> I have project with an XCore model for which the code is automatically
> generated (e.g., to emf-gen). For some time now, together with the
> model classes, a validation package is created (and a
> description.txt). How can I disable that?
>
> In the generated classes, the generated JavaDoc states
> "This can be disabled with -vmargs
> -Dorg.eclipse.emf.examples.generator.validator=false."
>
> So I added "-vmargs
> -Dorg.eclipse.emf.examples.generator.validator=false" to the
> eclipse.ini file (actually only the -D.. part in the general -vmargs
> section -- for everyone who wants to disable this as well). This
> helped. But I'm wondering if there is a possibility to avoid
> generation of the validator examples without that explicit (and rather
> hidden) setting.
>
> The weird thing: My colleagues are using the very same setup (and the
> code is shared via git), and on their machines no validation package
> is generated even without explicitly avoiding it via the eclipse.ini
> setting. We are all using Eclipse Mars and XCore SDK 1.3.1.
>
> Actually, this happens only when the generator is triggered
> automatically, e.g., when changing the Xcore file. When I generate the
> code explicitly via an MWE script (with The weird thing: My colleagues
> are using the very same setup (using the
> org.eclipse.xtext.generator.GeneratorComponent component), no
> validation package is generated.
>
> I haven't found any settings in the Xcore preferences.
>
> Is it possible to disable the generation in the Xcore file explicitly?
> E.g. in the @GenModel (although I haven't found any such field in the
> properties view).
>
> Cheers,
> Jens


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Disable generation of validation package from Xcore [message #1711003 is a reply to message #1711002] Mon, 12 October 2015 09:32 Go to previous messageGo to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 313
Registered: July 2009
Senior Member
On 12.10.15 11:26, the super-fast Ed Merks wrote:
> That's all a long winded way of saying that I think you've installed the
> example themselves in your IDE and that people who don't have the
> problem haven't done that. Also, it's likely not in your target
> platform, so when you launch MWE, it's not present and doesn't kick in.
> So best you avoid doing that, uninstalling the examples if necessary.

Thank you very much! That's explains the different behavior. Haven't
thought about uninstalling the examples... thanks!

Cheers,
Jens
Re: Disable generation of validation package from Xcore [message #1711021 is a reply to message #1711003] Mon, 12 October 2015 12:37 Go to previous message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
Jens, you got "super-fast" but neglected "and nearly psychic" Smile
Previous Topic:[CDO] Server error with MySQL DBStore
Next Topic:[CDO] query on a view other than latest
Goto Forum:
  


Current Time: Thu Apr 25 16:21:26 GMT 2024

Powered by FUDForum. Page generated in 0.03083 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top