简体   繁体   English

在MTL文件中调试Acceleo M2T转换

[英]Debugging Acceleo M2T Transformation within MTL file

I'm currently setting up an Acceleo project to generate Java source code from an Eclipse UML2 model. 我当前正在设置一个Acceleo项目,以从Eclipse UML2模型生成Java源代码。 I do have experiences with the Xtend code generator, but not with the Acceleo one. 我确实有使用Xtend代码生成器的经验,但是没有使用Acceleo的经验。 However, I wanted to try Acceleo as an alternative to Xtend. 但是,我想尝试Acceleo作为Xtend的替代方案。

Unfortunately, I do have problems with debugging the M2T transformation from within the MTL template file. 不幸的是,我在从MTL模板文件中调试M2T转换时确实遇到问题。 All breakpoints I set in the MTL are just ignored and the debugger runs the transformation without stopping. 我在MTL中设置的所有断点都将被忽略,调试器将在不停止的情况下运行转换。

I've searched Stackoverflow and other sources for help, but none of the responses helped me to get the debugger to work. 我已经搜索了Stackoverflow和其他资源以寻求帮助,但是没有任何响应可以帮助我使调试器正常工作。

I'm running the transformation as an Acceleo Application and am using the Java Application runner since the Acceleo Plug-in Application is no longer supported with Eclipse Oxygen. 由于Eclipse Oxygen不再支持Acceleo插件应用程序,因此我正在以Acceleo应用程序的形式运行转换,并使用Java应用程序运行器。

Did anyone of you have similar troubles and/or found any solution? 你们中有人有类似的麻烦和/或找到任何解决方案吗?

Thanks for any hint. 感谢您的任何提示。

Best regards Timo Rohrberg 最好的问候蒂莫·罗伯格

I have the same requirement, but apparently there is not way to debug it at runtime, as far as I know. 我有相同的要求,但是据我所知,显然没有办法在运行时对其进行调试。 https://www.eclipse.org/forums/index.php?t=msg&th=1080008&goto=1740153&#msg_1740153 https://www.eclipse.org/forums/index.php?t=msg&th=1080008&goto=1740153&#msg_1740153

Create a wrapper service for java printing/logging. 为Java打印/记录创建包装服务。 This is not the best solution, but, I was able to make do. 这不是最好的解决方案,但是,我能够做到。

You could also use the acceleo interpreter (using the acceleo eclipse perspective) to try and evaluate queries before changing your code. 您还可以使用acceleo解释器(使用acceleo eclipse透视图)来尝试和评估查询,然后再更改代码。 https://wiki.eclipse.org/Acceleo/Interpreter https://wiki.eclipse.org/Acceleo/Interpreter

I use this with papyrus and it works nicely. 我将其与纸莎草纸一起使用,效果很好。

I found a solution (or workaround) to debug .mtl files. 我找到了调试.mtl文件的解决方案(或解决方法)。

In the manifest editor window of your eclipse plugin 在eclipse插件的清单编辑器窗口中

-on the runtime tab add your bin folder (the folder containing the compiled .class and .emtl files) to the classpath. -在运行时选项卡上,将bin文件夹(包含已编译的.class和.emtl文件的文件夹)添加到类路径。

After this your breakpoints in the .mtl files will work, if you run your Acceleo launcher in "Acceleo Plug-in Application" mode. 此后,如果以“ Acceleo插件应用程序”模式运行Acceleo启动器,则.mtl文件中的断点将起作用。 (Configuration section in the Acceleo launcher window) (Acceleo启动器窗口中的“配置”部分)

(Tested with Eclipse 19-03, Acceleo 3.7) (使用Eclipse 19-03,Acceleo 3.7测试)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM