Acceleo 3 standalone with traceability [message #1841248] |
Fri, 07 May 2021 19:03  |
Eclipse User |
|
|
|
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!
|
|
|
Re: Acceleo 3 standalone with traceability [message #1841254 is a reply to message #1841248] |
Sat, 08 May 2021 04:55   |
Eclipse User |
|
|
|
Hi
The "Acceleo Plug-in Application" has been broken for very many years. I thought that it had now been retracted as a menu option. Are you sure you are using a recent release? There has been a maintenance release at least every year.
I have never used the traceability, so I can only recommend that if you have some environment in which it works, you use the debugger to contrast how the interesting functionality starts in working / not-working contexts. Else follow AcceleoPreferences.switchTraceability(boolean) though to what it sets and then search for what reads that setting / has "trace" in its class / method names. In particular search the JUnit tests for something that animates traceability.
Since Acceleo execution is pretty much a standalone invocation anyway, I see no reason why it shouldn't work.
Regards
Ed Willink
|
|
|
Re: Acceleo 3 standalone with traceability [message #1841562 is a reply to message #1841254] |
Thu, 20 May 2021 15:49  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.02609 seconds