Created
May 24, 2012 20:44
-
-
Save michalbcz/2784124 to your computer and use it in GitHub Desktop.
groovy's AntBuilder and external ant tasks (example with Google Closure The JavaScript Compiler)
This file contains hidden or 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
import groovy.grape.Grape; | |
// to explain why I am not using @Grape annotation | |
// see http://stackoverflow.com/questions/1641116/groovy-with-grape-and-antbuilder-classloader-problem | |
Grape.grab( | |
group: 'com.google.javascript', | |
module: 'closure-compiler', | |
version: 'r1918', | |
classLoader:this.class.classLoader.rootLoader /* needed because of ant.taskdef classloader */) | |
def ant = new AntBuilder() | |
// https://developers.google.com/closure/compiler/ | |
ant.taskdef(name: 'compileJs', classname: 'com.google.javascript.jscomp.ant.CompileTask') | |
ant.compileJs( | |
compilationLevel: "whitespace", /* next values are 'simple' and 'advance' - see http://bit.ly/JfZROa */ | |
warning: "verbose", | |
debug: "true", | |
output: /... insert path to result file here .../) { | |
sources( | |
dir: "... insert root dir where to find files in files property", | |
files: "first.js, second.js, insert_your_name.js") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment