Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » tycho question. postpone xtend source code generation(xtext application building via maven)
tycho question. postpone xtend source code generation [message #1772561] Tue, 12 September 2017 12:36 Go to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Hello

Could you please clarify the following behavior. When I run build of my application via maven I Observe the maven each time generates a few xtend file like

MyDslRuntimeModule.xtend
MyDslStandaloneSetup.xtend
MyDslGenerator.xtend - last one contains default implementation of my dsl generator.

In my case these classes were implemented in pure java.
How can I postpone creating of this classes?

The same situation I observe in ui plugin. In case I work in Eclipse IDE I do it one time running MWE2 workflow for my dsl.

So I need to configure the same behavior in maven build like in manually build in Eclipse IDE. I have to run MWE2 workflow only if definition of my DSL is changed

Thank you in advance
Alex

[Updated on: Tue, 12 September 2017 12:52]

Report message to a moderator

Re: tycho question. postpone xtend source code generation [message #1772568 is a reply to message #1772561] Tue, 12 September 2017 14:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi, i dont understand the problem. can you please explain. if you configure the xtend-maven-plugin correct bidirectional interoperation with java should work fine.

if you dont want xtend stubs to be generated by the workflow you have to have a look at the workflow as follows

(just a example, might be buggy at some places, needs to be adaped to your fragments)

code = {
				preferXtendStubs = false
				encoding = "US-ASCII"
				lineDelimiter = "\n"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}

.....


			outline= {
				generateXtendStub = true
			}






Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: tycho question. postpone xtend source code generation [message #1772572 is a reply to message #1772568] Tue, 12 September 2017 14:47 Go to previous messageGo to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
OK, try to explain more detailed

Scenario 1
1. Create new Xtext project via Eclipse for a DSL (org.mycompany.MyDsl for example)
2. Select file GenerateMyDsl.mwe2 and run it as MWE2Workflow

Result is generated xtend stub for org.mycompany.mydsl plugin and for org.mycompany.mydsl.ui plugin.

Then I extend my DSL for my business need. If change something in MyDsl definition
I run GenerateeMyDsl.mwe2 again.

Scenario 2
1. Create new Xtext project via Eclipse for a DSL and use maven as default builder

in case user run mvn package command (for example ). Each build starts from generating code and stub via process defined in GenerateMyDsl.mwe2

My question is :
Are the way to configure maven build that
- skip running GenerateMyDsl.mwe2
- user run GenerateMyDsl.mwe2 via option in command line

Seems to me I can resolve this issue via creating maven profile. Are there anothe ways?
Re: tycho question. postpone xtend source code generation [message #1772573 is a reply to message #1772572] Tue, 12 September 2017 15:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
the only thin k that terminines java or xtend is the workflow so change it

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: tycho question. postpone xtend source code generation [message #1772575 is a reply to message #1772573] Tue, 12 September 2017 15:17 Go to previous messageGo to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
I'm sorry

What does mean "thin k" in your answer?

So if user run maven build MWE2 workflow will executed each time?
MWE2 workflow creates stub for example for DSLGenerator so
In this case if user change something in DSLGenerator
it will be overwritten by MWE2 workflow?

Seems to me I did not understand something
Re: tycho question. postpone xtend source code generation [message #1772576 is a reply to message #1772575] Tue, 12 September 2017 15:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Should read thing

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: tycho question. postpone xtend source code generation [message #1772578 is a reply to message #1772576] Tue, 12 September 2017 15:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
And the workflow decides if Java or xtend stub is generated and will usually not override existing files


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: tycho question. postpone xtend source code generation [message #1772631 is a reply to message #1772578] Wed, 13 September 2017 09:30 Go to previous message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Hello Christian

Thank you for suggestions.
The following fixes helped me

code = {
				encoding = "windows-1252"
				lineDelimiter = "\r\n"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
				[b]preferXtendStubs=false[/b]
			}


The option preferXtendStubs gives me expected results.
Previous Topic:How to specify an array value in mwe2
Next Topic:Error during building the .web project due to Xtext builder
Goto Forum:
  


Current Time: Fri Apr 19 19:43:50 GMT 2024

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

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

Back to the top