Created
March 17, 2012 18:33
-
-
Save musketyr/2063900 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GaelykPrecompileTemplateTask extends DefaultTask { | |
static HiJackGroovyShell hjgs = [] | |
static SimpleTemplateEngine ste = [hjgs] | |
static String getTemplateAsScript(String template){ | |
ste.createTemplate(template) | |
hjgs.scriptText | |
} | |
} | |
class HiJackGroovyShell extends GroovyShell { | |
String scriptText | |
@Override | |
public Script parse(String scriptText, String fileName) | |
throws CompilationFailedException { | |
this.scriptText = scriptText | |
return super.parse(scriptText, fileName) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment