Files
spring-webflow/spring-js-resources/spring-js-resources.gradle
Rossen Stoyanchev cc4506d921 Replace Ant build with gradle
The master branch has been using Gradle for a while. The expectation
at the time was that minor maintenance releases can be done on 2.3.x
with the existing Ant build. However that is no longer possible to
perform a release and we need to perform a 2.3.3 release.

The change mirrors similar changes on the master branch:

4e81930b72
50a1cf1def

Issue: SWF-1615
2013-12-16 16:29:42 -05:00

43 lines
1.3 KiB
Groovy

configurations {
shrinksafe
}
dependencies {
shrinksafe "org.dojotoolkit:dojo-shrinksafe:1.7.2"
}
task prepareResources(type: Jar) { jar ->
doLast() {
minify("Spring.js")
minify("Spring-Dojo.js")
ant.unzip(src: "${projectDir}/dojo-build/dojo-build.zip",
dest: "${buildDir}/resources/main/META-INF/web-resources")
}
}
void minify(fileName) {
project.ant {
def sourceDir = "${basedir}/src/main/resources/META-INF/web-resources/spring/"
def outputDir = "${buildDir}/resources/main/META-INF/web-resources/spring/"
copy(file: "${outputDir}/${fileName}", tofile: "${outputDir}/${fileName}.uncompressed.js")
java(classname: "org.dojotoolkit.shrinksafe.Main",
classpath: configurations.shrinksafe.asPath, fork: true,
output: "${outputDir}/${fileName}.TMP.js") {
arg(value: "${sourceDir}/${fileName}")
}
move(file: "${outputDir}/${fileName}.TMP.js", toFile: "${outputDir}/${fileName}") {
filterchain {
filterreader(classname: "org.apache.tools.ant.filters.StripLineBreaks")
}
filterchain {
concatfilter(prepend: "${basedir}/../src/dist/javascript-copyright.txt")
}
}
}
}