Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext -Xtend deployment (Deploy the Xtend and Xtext project )
icon5.gif  Xtext -Xtend deployment [message #1760742] Tue, 02 May 2017 09:58 Go to next message
Eclipse UserFriend
Hi all,
I recently wrote an Xtext Grammar and a corresponding Xtend application to generate C++.
Everything works well.

However, I wish to know if there is a way to deploy this setup and generate code directly from a terminal command. This means, without having to run the Eclipse Runtime.

Thanks Very Happy
Re: Xtext -Xtend deployment [message #1760759 is a reply to message #1760742] Tue, 02 May 2017 12:34 Go to previous messageGo to next message
Eclipse UserFriend
Best to ask on the TMF forum. You'll find a link on the Xtext home page.
Re: Xtext -Xtend deployment [message #1760856 is a reply to message #1760759] Wed, 03 May 2017 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Hi

This depends on the situation of how you generate and how many model files you have

- you can use maven or gradle to call the generator
- you can create (and package) a Java main that reads the file and calls the generator (to ge at stuff add/modify in the workflow generator={generateXtendMain=true}
- then you an use maven or gradle to create a runnable appplication or you run it once from eclipse end use the Export _> Java _> runnable jar file wizard
Re: Xtext -Xtend deployment [message #1760866 is a reply to message #1760856] Wed, 03 May 2017 15:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian,
Thanks for your reply.

The set up of my project is as follow:

1) I have a "preprocessing" app written in C++ that generates a ".dsl" file. This is then the input file for the Xtend code generator.

2) There is only 1 model file.

3)For the generation, I simply extend the AbstractGenerator

My goal is to write a bat script that will launch the preprocessing app and pass its ouput file (.dsl) to the Xtend application.

I am investigating into the solution you mentioned earlier
Re: Xtext -Xtend deployment [message #1760867 is a reply to message #1760759] Wed, 03 May 2017 15:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,
Thanks for the clarification,
I wasn't sure where to post it.
Re: Xtext -Xtend deployment [message #1760868 is a reply to message #1760867] Wed, 03 May 2017 15:41 Go to previous messageGo to next message
Eclipse UserFriend
as i said

step (1) in workflow

generator = {
				generateXtendMain = true
			}


(2) run workflow
(3) run org.xtext.example.mydsl.generator.Main
(4) export -> java -> runnable jar file
- select main in launch config
- select target
- finish
java -jar <exported-name>.jar
icon14.gif  Re: Xtext -Xtend deployment [message #1760944 is a reply to message #1760868] Thu, 04 May 2017 10:01 Go to previous message
Eclipse UserFriend
Hi Christian,

many more thanks, it was quite straightforward and worked as a charm.

I will now write the bat script to automate the whole process

Cool
Previous Topic:Exception when accessing xtext index
Next Topic:Invalid synchronization of resources
Goto Forum:
  


Current Time: Mon Jul 07 16:24:21 EDT 2025

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

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

Back to the top