开发者

See statements as Groovy scripts executes

开发者 https://www.devze.com 2023-01-23 15:53 出处:网络
Is it possible to s开发者_如何学编程ee the statements of Groovy script as it executes, like the output of running bash with -v or -ex? What would it take to do this programmatically?

Is it possible to s开发者_如何学编程ee the statements of Groovy script as it executes, like the output of running bash with -v or -ex? What would it take to do this programmatically?


Is it possible to see the statements of Groovy script as it executes, like the output of running bash with -v or -ex?

I suppose it's possible, but I'm not aware of any tool that does this.


This could be done relatively easily using a global AST transformation whose public void visit(ASTNode[] astNodes, SourceUnit sourceUnit) method adds println Statements after or before each Statement visted in a class.

See http://groovy.codehaus.org/Global+AST+Transformations for more details.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号