[xpand + xtend]: how to access MWE workflow properties in Xpand templates, with xtend 2.17.x? [message #1805607] |
Thu, 18 April 2019 15:00  |
Eclipse User |
|
|
|
I'm facing a problem tryin to migrate some Xpand-based generator projects from oxygen to eclipse-2019-03 release of eclipse modeling platform.
Until Oxygen release I used to access some MWE workflow properties from Xpand templates using Xtend standard utility library (org.eclipse.xtend.util.stdlib plugin), as described in the following example:
In the MWE workflow definition a bundle of properties is loaded from a properties file, and then the generator is called:
<workflow>
...
<component class="org.eclipse.xtend.util.stdlib.PropertiesReader">
<propertiesFile value="${propertiesFile}"/>
</component>
...
<!-- call the generator... -->
</workflow>
In Xpand templates an Xtend (java) extension is used to access property values:
...
String getProperty(String name) : JAVA
org.eclipse.xtend.util.stdlib.PropertiesExtension.getProperty(java.lang.String);
String getGenerateAppModulesProperty() :
if getProperty("generate-appmodules") != null then
""+getProperty("generate-appmodules")
else
"";
...
I don't know if this is the best way to accomplish the task, but it worked since 2009 until oxygen release (with Xtend v.2.2.x).
Tryin to migrate to eclipse-2019-03, and with xtend v. 2.17 I noticed that there is no more xtend.util.stdlib plugin, so that method does not work anymore.
I need some suggestion to find an alternative way.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05964 seconds