Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to install my xtext dsl as a plug in to Eclipse?
How to install my xtext dsl as a plug in to Eclipse? [message #1066419] Tue, 02 July 2013 15:07 Go to next message
psilos panipsilos is currently offline psilos panipsilosFriend
Messages: 23
Registered: June 2013
Junior Member
Hi guys,

I have created a dsl using xtext. Now i want to export it as a plug-in to eclipse so that my dsl appears in the wizard when choosing "crate new project"

I followed the very simple tutorial in the following link

http://www.openarchitectureware.org/pub/documentation/4.2/html/contents/xtext_tutorial.html#d0e1817

that simple says : File -> Export -> Export Deployable plug-ins and fragments. However when I do this I get the following errors:

1. ERROR in B:\PhD\Eclipse_Modelling_Workspace\org.xtext.example.mydsl.ui\src-gen\org\xtext\example\mydsl\ui\AbstractMyDslUiModule.java (at line 68)
return org.xtext.example.mydsl.ui.labeling.MyDslLabelProvider.class;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
org.xtext.example.mydsl.ui.labeling.MyDslLabelProvider cannot be resolved to a type

Anybody has an idea how to resolve this issue? Alternatively do you know another way to create the plug-in ? I ve also looked the following post but seems quite complex to me:

http://stackoverflow.com/questions/11968326/when-deploying-xtext-how-to-integrate-with-eclipse-via-plugin

thank you
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066420 is a reply to message #1066419] Tue, 02 July 2013 15:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi please check the build.properties in the projects for warnings
(maybe xtend-gen missing)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066441 is a reply to message #1066420] Tue, 02 July 2013 16:43 Go to previous messageGo to next message
psilos panipsilos is currently offline psilos panipsilosFriend
Messages: 23
Registered: June 2013
Junior Member
Hi Christian,

you were right , I was missing the xtend-gen. Problem solved.

So I created a new project and added a file with my dsl extension .the usual message popped up saying whether i want to add the Xtext nature to my project. So I filled in a model in my Mymodel.mydsl file. Now I want to generate the code out of the Mymodel.mydsl file. Do you know how can I do that?

Previously I was running the generator "MyDslGeneratorMWE.mwe2" in order to generate code out of my model.
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066445 is a reply to message #1066441] Tue, 02 July 2013 16:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi if you use default setup and change the pregenerated generator and
you have build automatically on the generator will be called if you
save the mydsl file

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066457 is a reply to message #1066445] Tue, 02 July 2013 17:38 Go to previous messageGo to next message
psilos panipsilos is currently offline psilos panipsilosFriend
Messages: 23
Registered: June 2013
Junior Member
Christian I m sorry but I cannot understand what you mean. I have attached a snapshot of my project structure to explain you what I mean.

The org.xtext.example.mydsl.xxx projects are the xtext projects which I used to create my dsl and run my xtend generator.
The Test project is the one I create to test my dsl. I have added a new file Test.hello with my model( .hello is the extension of my dsl). And now I want to generate the code for the Test.hello file

1) what do you mean by "default setup"?
2) Which one is the "pregenerated generator"? Is it the one in my intial xtext project (org.xtext.example.mydsl.mydsl? The MyDslGeneratorMWE.mwe2 ?
3) What do you mean by "build automatically on the generator"? Which generator are you referring to ?


Thank you for your for your support

  • Attachment: Capture.PNG
    (Size: 28.94KB, Downloaded 262 times)
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066459 is a reply to message #1066457] Tue, 02 July 2013 17:43 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i recommend you to do the tutorials. it contains this usecase.
of course you have to start a runtime eclipse for the builder doing the work.
in the mwe case simply run the workflow after setting properties appropriate (modeldir or something like that)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066462 is a reply to message #1066459] Tue, 02 July 2013 17:58 Go to previous messageGo to next message
psilos panipsilos is currently offline psilos panipsilosFriend
Messages: 23
Registered: June 2013
Junior Member
Ok , I see what you mean.

Yes I am able to do that. I run the project as eclipse application and then when I save my dsl file, the generator is invoked automatically .That works perfectly

However I was wondering how can I distribute my dsl so that other users can create my dsl files and then generate the code automatically.

Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066463 is a reply to message #1066462] Tue, 02 July 2013 18:13 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
as i said: depends on how you want to trigger that (standalone/mwe/in eclipse)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066464 is a reply to message #1066463] Tue, 02 July 2013 18:18 Go to previous messageGo to next message
psilos panipsilos is currently offline psilos panipsilosFriend
Messages: 23
Registered: June 2013
Junior Member
alright so as far as i understand I was able to run it as mwe and in Eclipse.

However I would like to run it as standalone. Any clue for that?

Btw could you please point me to that tutorial that you mentioned above? does it contain a usecase for the standalone mode?

Thank you
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066466 is a reply to message #1066464] Tue, 02 July 2013 18:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

no it was targeting the eclipse usecase.
standalone depends on your usecase
1 file or multiple etc
(for one file you can let the generatorfragment generate a javamain you may manipulate to handle multiple files as well)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066472 is a reply to message #1066466] Tue, 02 July 2013 19:08 Go to previous messageGo to next message
psilos panipsilos is currently offline psilos panipsilosFriend
Messages: 23
Registered: June 2013
Junior Member

Suppose that a user ( who does not have the xtext project) creates a new java project and wants to use my dsl in order to generate some java code. So he creates a file test.mydsl adds a model inside and then wants to generate the java code out of the test.mydsl file. How could this scenario be realised?

Thank you
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066473 is a reply to message #1066472] Tue, 02 July 2013 19:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

the user saves the .mydsl file. the code is generated automatically. (try the tutorial from the docs)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066475 is a reply to message #1066473] Tue, 02 July 2013 19:22 Go to previous messageGo to next message
psilos panipsilos is currently offline psilos panipsilosFriend
Messages: 23
Registered: June 2013
Junior Member
Thank you . I ll have a look.

could you please tell me which tutorial and docs are you referring to?
I would be grateful if you could send me the link.
Re: How to install my xtext dsl as a plug in to Eclipse? [message #1066477 is a reply to message #1066475] Tue, 02 July 2013 19:27 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
(1) http://www.eclipse.org/Xtext/documentation.html#FirstFiveMinutes
(2) http://www.eclipse.org/Xtext/documentation.html#DomainModelWalkThrough
(3) http://www.eclipse.org/Xtext/documentation.html#DomainmodelNextSteps


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[XBase] Model inferer: Problem with manually building AST
Next Topic:Referencing global scope items with prefixed names
Goto Forum:
  


Current Time: Thu Apr 25 14:41:50 GMT 2024

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

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

Back to the top