Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xtend template generator not working in deployed app
xtend template generator not working in deployed app [message #1811087] Mon, 26 August 2019 17:48 Go to next message
Eclipse UserFriend
Why would a deployed app be able to run it's generator, but have it's xtend templates not get interpreted?

For example, my generated outputs look like copies of my xtend generator:

??FOR connBundle : PBXAppImpl.getInstance().connectionBundles??
connBundle: ??connBundle.name??
??FOR conn : connBundle.connections??
conn: ??conn.name?? @??conn.hashCode??:
src: ??FOR src : conn.sources?? ??src.name?? ??ENDFOR??
dest: ??FOR dest : conn.destinations?? ??dest.name?? ??ENDFOR??
??ENDFOR??
??ENDFOR??

I've never seen this before, but it's now happening in both my Run Configuration in Eclipse and in my deployed application (whose target is set up with Tycho/Maven).

Xtext 2.14 (installed over 2.12)
Re: xtend template generator not working in deployed app [message #1811088 is a reply to message #1811087] Mon, 26 August 2019 17:50 Go to previous messageGo to next message
Eclipse UserFriend
Are you sure use configure a proper encoding in your project and Xtend file and build system (especially on windows )

[Updated on: Mon, 26 August 2019 17:53] by Moderator

Report message to a moderator

Re: xtend template generator not working in deployed app [message #1811089 is a reply to message #1811088] Mon, 26 August 2019 18:04 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for helping.

Possibly not. You are talking about the Project created in the user's workspace with the deployed application right?

What should the encoding be?

I'm using the New Project Wizard provided with 2.14 and I had to make a small tweak in that release code to include

projectNatures += #[XtextProjectHelper.NATURE_ID]
builderIds += org.eclipse.xtext.ui.XtextProjectHelper.BUILDER_ID


into the the generateProjects method of the wizard template

Should I be adding a friendly encoding there too somehow?
Re: xtend template generator not working in deployed app [message #1811090 is a reply to message #1811089] Mon, 26 August 2019 18:06 Go to previous messageGo to next message
Eclipse UserFriend
No the project containing the xtend file. Have a look at it's generated java file (MyDslGenerator.java)
Re: xtend template generator not working in deployed app [message #1811091 is a reply to message #1811090] Mon, 26 August 2019 18:07 Go to previous messageGo to next message
Eclipse UserFriend
How do you build. What is the encoding in your oroject or workspace ( see properties and preferences )
Re: xtend template generator not working in deployed app [message #1811158 is a reply to message #1811091] Tue, 27 August 2019 19:42 Go to previous message
Eclipse UserFriend
Thank you for the pointers. It looks like changing the workspace/project text encoding property to UTF-8 was key. I had already changed it for the xtend file in my generator to get it to work, but there needed to be more done.

Doing this in my developer workspace got the Run Config test launch working again.

I also seemed to need to tweak my tycho/maven dsl.parent pom to include:

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>


Doing that helped get my deployed application working again.
Previous Topic:Text to EMF Model Generator
Next Topic:Validation of Cross-references to Derived Objects is Sketchy - How to debug?
Goto Forum:
  


Current Time: Thu Feb 13 04:06:23 GMT 2025

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

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

Back to the top