Acceleo 3 standalone with traceability [message #1841248] |
Fri, 07 May 2021 19:03 |
Elie Richa Messages: 72 Registered: February 2016 |
Member |
|
|
Hello folks,
I'm looking to gather traceability information linking my Acceleo templates to the generated files and vice versa.
I saw advice here about using AcceleoPreferences.switchTraceability(boolean) to activate tracing, but that doesn't seem to work in standalone mode.
Is there an alternate way to activate tracing in standalone mode?
I also tried using the Acceleo Application run configuration both with Runner "Java Application" and "Acceleo Plug-in Application". The former ran but didn't produce the traceability model. The latter did not start at all.
Even though my main use is standalone, a solution in the Eclipse plug-in mode would be acceptable.
Any ideas how/if I could do that?
Thanks!
Elie Richa, Ph.D
Software Engineer, AdaCore
https://www.adacore.com
|
|
|
|
Re: Acceleo 3 standalone with traceability [message #1841562 is a reply to message #1841254] |
Thu, 20 May 2021 15:49 |
Elie Richa Messages: 72 Registered: February 2016 |
Member |
|
|
Hello,
Thanks Ed for your suggestions. I was using Eclipse 2020-12 and Acceleo 3.7.11.202102190929. So it's a fairly recent release and I still saw remnants of the Acceleo Plug-in Application.
In the end I went on a different route which seems promising. I registered an IAcceleoTextGenerationListener and implemented the textGenerated(AcceleoTextGenerationEvent arg0) event. That seems to be called at every text emission, and it receives the Acceleo Block object that is emitting the text (ForBlock, IfBlock etc...). The Block object is in an EMTL resource with a URI that can help me get to the original MTL file, and it contains start/end character offsets in the original MTL file.
With all this data I believe I should be able to construct a traceability file that links each generated text substring to the MTL location that created it.
Elie Richa, Ph.D
Software Engineer, AdaCore
https://www.adacore.com
|
|
|
Powered by
FUDForum. Page generated in 0.03847 seconds