Skip to content

Instantly share code, notes, and snippets.

@jurberg
Last active December 12, 2015 02:29
Show Gist options
  • Save jurberg/4699237 to your computer and use it in GitHub Desktop.
Save jurberg/4699237 to your computer and use it in GitHub Desktop.
Run the Require.JS optimizer when creating a war file.
eventCreateWarStart = { warName, stagingDir ->
def curDir = new File('Scripts');
ant.exec(outputproperty: "cmdOut", errorproperty: "cmdErr", resultproperty: "cmdExit", failonerror: "false", executable: "java") {
arg(line: "-cp ${new File(curDir, 'js.jar').absolutePath}")
arg(line: "org.mozilla.javascript.tools.shell.Main")
arg(line: "${new File(curDir, 'r.js').absolutePath}")
arg(line: "-o")
arg(line: "name=bootstrap")
arg(line: "baseUrl=${stagingDir}/js")
arg(line: "out=${stagingDir}/js/bootstrap-build.js")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment