Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Adding DSL nature to project in same workspace
Adding DSL nature to project in same workspace [message #718375] Wed, 24 August 2011 07:05 Go to next message
Daniel Missing name is currently offline Daniel Missing nameFriend
Messages: 101
Registered: July 2011
Senior Member
Hi everybody.

Is it possible to add the DSL-Xtext nature to a project within the same workspace/eclipse instance where the DSL ist developed? I added some test-data to my test-project for writing the compiler/code-gen templates. Now I want to have the xtext nature of my DSL added to my dsl.test project.

Is there a way to auto-deploy the xtext-nature into the currently running eclipse instance and use it there? Or is there always a need for running a second eclipse instance? It's an annoying workflow to develop within two eclipse instances:

Change code in the first eclipse instance, wait for build, refresh the second eclipse, wait for build, test the workflow and the template....

Cheers
Daniel

[Updated on: Wed, 24 August 2011 07:35]

Report message to a moderator

Re: Adding Xtext nature to project in same workspace [message #718377 is a reply to message #718375] Wed, 24 August 2011 07:09 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

I guess you are not talking about the Xtext nature but rather the plugin you develop. If you write unit tests for the generator (or a simple main-class that reads the model and executes the templates), you don't have to deploy the plugin at all (while developing). I think the domain-model example contains a sample main-class to serve as inspiration.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Adding Xtext nature to project in same workspace [message #718380 is a reply to message #718377] Wed, 24 August 2011 07:31 Go to previous messageGo to next message
Daniel Missing name is currently offline Daniel Missing nameFriend
Messages: 101
Registered: July 2011
Senior Member
Hi.

Yes I mean the plugin I develop. That's what I meant by "DSL-Xtext nature" Wink The project I want to create is not the unit-test project. It's more a language usage test. It's a project which I use for developing the generator templates. Think of it like the dummy-projects you create during debugging your own DSL. As an input for the generator template I create some files within the same test-project.

I could write the template code in the language-debugging workspace but this workspace is rather a testing-environment than a stable environment for already using the code. In my main development workspace my DSL projects are added to a SVN repository and therefore I want to keep my code (testfiles and work-in-progress xtend template) there.

It would be awesome if I could already use my DSL in the same Eclipse workspace I'm running during DSL development. Think of this scenario:
I add a special xtext-reference to my sample project within the same workspace and violá the DSL can be used within this project. Of course such a feature is not available yet. But is there a possiblity to deploy the DSL plugin into the currently running eclipse and refresh the plugin afterwards? This would enable the usage of my dsl within the same workspace.

Daniel

[Updated on: Wed, 24 August 2011 07:33]

Report message to a moderator

Re: Adding Xtext nature to project in same workspace [message #718404 is a reply to message #718380] Wed, 24 August 2011 08:33 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

I still quite don't understand. The editor does not work in the current workspace without deployment, but you can develop the generator as the metamodel classes are present. So you can invoke the generator on model files located in the development workspace via a unit test or a main class that reads the models in standalone mode.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Adding Xtext nature to project in same workspace [message #718428 is a reply to message #718404] Wed, 24 August 2011 09:39 Go to previous messageGo to next message
Daniel Missing name is currently offline Daniel Missing nameFriend
Messages: 101
Registered: July 2011
Senior Member
I try to ask my question simpler:

In my development eclipse I have multiple projects:
at.mydsl
at.mydsl.test
at.mydsl.ui

I want to use my dsl "at.dsl" in my "at.mydsl.test" project.

Why? Because I'm writing some test input files there and want to use the comfort of "at.mydsl.ui".

The primary question is: How can I do that?

Of course the plugin needs to be deployed and loaded by the Eclipse. Probably there is a way how I can deploy at.mydsl and at.mydsl.ui into my currently running eclipse instance and reload it after I updated stuff. (without restarting eclipse)
Re: Adding Xtext nature to project in same workspace [message #718429 is a reply to message #718428] Wed, 24 August 2011 09:44 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

what about exporting the plugins to the dropins folder / an update site
and use/install it from there and restart your eclipse

but there easier way is of cource to import the test plugin into your runtime eclipse
and develop the test files there

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[xtend] Question on "Create Functions"
Next Topic:Prevent code generation when errors exist (Xtext2.0)
Goto Forum:
  


Current Time: Thu Apr 25 13:46:37 GMT 2024

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

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

Back to the top