Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How do I disable code generation in my test plugin?
How do I disable code generation in my test plugin? [message #831162] Wed, 28 March 2012 14:54 Go to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
I have a couple of test files written in my DSL in my tests plugin/project. Most of the tests use inline multi-line strings and Xtend but in four cases, I need to test code which does some magic with URLs and the classpath, so I really need resources in the classpath for that.

Since loading the resources only works when the extension is correct, I can't give the files a fake extension.

Now my problem: My DSL also has a code generator. This means that eventually, I end up with a couple of generated files in places where I can't have them (they don't compile, for example, and one even contains an error to test error handling when information is split across several files).

I can't disable the Xtext nature because the tests project uses Xtend so for these files, I do need code generation.

Since the generator runs inside Eclipse (I have the DSL plugins installed for other projects), there is no way to override the code generator in Guice.

How can I disable the code generator in this case?

To make this clear: The code generator is in a plugin installed in my current Eclipse IDE, not the one which I have in the workspace. It would be simple to disable the one in the workspace but how can I disable code generation after installing the DSL plugins in my IDE?

[Updated on: Wed, 28 March 2012 14:55]

Report message to a moderator

Re: How do I disable code generation in my test plugin? [message #831195 is a reply to message #831162] Wed, 28 March 2012 15:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi if you go to the properties of the project. Is there a Mydsl node
with a complier/generator or whatever it is named sub node where you
can disable the generator?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How do I disable code generation in my test plugin? [message #831223 is a reply to message #831195] Wed, 28 March 2012 16:30 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
No, there is just the standard "Xtext Project Builder".
Re: How do I disable code generation in my test plugin? [message #831243 is a reply to message #831223] Wed, 28 March 2012 16:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi which XText version do you use?
1 create new mydsl project with generator
2 install it to an eclipse
3 create within this eclipse a project with mydsl files
4 right click the project and select properties
5 select MyDsl then Compiler
6 select enabled project specific settings
7 disable compiler is activated

Works for me with Xtext 2.2.x


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How do I disable code generation in my test plugin? [message #832764 is a reply to message #831243] Fri, 30 March 2012 15:02 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
I upgraded to Xtext 2.2.1 but I don't get an entry in the project's properties dialog.

I'm not eager to recreate the whole project from scratch - can you tell me how I can add this feature to an existing project?
Re: How do I disable code generation in my test plugin? [message #832771 is a reply to message #832764] Fri, 30 March 2012 15:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

did you merge plugin.xml_gen to plugin.xml? you may have to add some fragments to the language workflow to (simple compare the workflow of a new project with yours)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How do I disable code generation in my test plugin? [message #835734 is a reply to message #832771] Tue, 03 April 2012 15:59 Go to previous message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Found the solution: http://stackoverflow.com/a/9991459/34088
Previous Topic:problem with Unordered Groups
Next Topic:Pretty printer for generated xtend code
Goto Forum:
  


Current Time: Thu Apr 25 03:43:59 GMT 2024

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

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

Back to the top