|Re: Acceleo : A solution for dependencies to another project with Java launcher [message #1775244 is a reply to message #1773507]
||Thu, 26 October 2017 16:57
| Mad Vin
Registered: September 2013
Thank you for your help, but i don't know what and how to do with the StandaloneProjectMap class in an Acceleo project, I've found no example on the Internet.
However, I've found something interesting to fix my problem of dependencies on the Acceleo settings.
To understand more clearly what I'm talking about, here is an easy example of Acceleo projects dependencies :
- 2 Acceleo projects : "generator.utils" and "generator.python"
- "generator.utils" is a project containing only utility queries and templates, that are useful for several kind of generators. So it contains no main template.
- "generator.python" is a project generating python language files from UML models. It depends of the "generator.util" project to be able to import and use the utility queries and templates.
- an Acceleo Configuration is created to configure a generation launcher on a main template of the "generator.python" project
=> If the Acceleo Configuration is configured to use the "Acceleo Plug-in Application" runner, the generation works.
=> If the Acceleo Configuration is configured to use the "Java Application" runner, the generation doesn't work because the dependency to the "generator.utils" project is unknown.
As said previously, the problem comes from the .emtl compiled files of Acceleo modules that reference by default the imported projects, templates and queries like this : "href="platform:/resource/generator.utils/bin/...".
But if you change the "Compilation Path Kind" setting on the "generator.python" project (Properties -> Acceleo Compiler -> Compilation Path Kind) by choosing "Absolute file system paths", the generation with the "Java Application" runner works now, because the links to the imported elements have been modified in the .emtl files like this : "href=../../../../../generator.utils/bin/..."
This solution enables to fix my problem because in my environment, the Acceleo projects must always be at a fixed position one to another. I just hope this setting exists on the old version of Acceleo I use on older projects.
However i have some questions :
1) Why this property in the Acceleo compiler settings says you use "absolute file system paths" while the generated paths are relative ones ? Paths starting by "../../../../../../" are not absolute but relative.
2) Is there a simple way (with an example) to use a property value (from a Java properties file) to replace the "platform:/resource/generator.utils" or "../../../../../../generator.utils" by the value of this property ? During the compilation ? During the execution ? Or else a "dirty" solution is to launch a script making a replaceAll in the .emtl files during the deployment of the jars on the user's PC.
Powered by FUDForum
. Page generated in 0.02192 seconds