Created
September 11, 2012 06:07
-
-
Save koizuss/3696344 to your computer and use it in GitHub Desktop.
Compile JavaScript on Gradle
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
archivesBaseName = 'hoge' | |
version = '0.0.0-snapshot' | |
import com.google.javascript.jscomp.ant.CompileTask | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.google.javascript:closure-compiler:rr2079.1' | |
} | |
} | |
task clean << { | |
ant.delete(dir: buildDir) | |
} | |
/** | |
* Compile JavaScript | |
* @see http://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/javascript/jscomp/ant/CompileTask.java | |
*/ | |
task compile << { | |
def jscomp = new CompileTask() | |
jscomp.output = file("${buildDir}/${name}/${archivesBaseName}-${version}.min.js") | |
jscomp.addSources(ant.filelist(dir: "src/main/js", files: "${archivesBaseName}.js")) | |
jscomp.execute() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment