paulk-asert opened a new pull request, #2769:
URL: https://github.com/apache/groovy/pull/2769

   …le system property
   
   The @ASTTest closure is evaluated during compilation, so merely compiling 
source which carries the annotation executes that code, whether or not the 
compiled result is subsequently run. Embedders which compile source they do not 
control have no way to turn this off.
   
   Add a groovy.asttest.enable system property, defaulting to true, which makes 
the annotation a no-op when set to false. This mirrors groovy.grape.enable for 
@Grab. The check is in visit(), so the closure is never scheduled onto a 
compilation phase rather than being scheduled and skipped.
   
   The property is read per-visit rather than into a static final field so that 
it can be exercised without relying on JVM startup state. Being a system 
property it is process-wide, exactly as groovy.grape.enable is: a JVM cannot 
enable @ASTTest for one compilation and disable it for another.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to