Files
spring-webflow/spring-js-resources/spring-js-resources.gradle
Stéphane Nicoll b78aa3cee8 Replace artifactory by standard repository structure
This commit removes the usage of the Artifactory plugin and replaces
it with a standard repository structure using the -PdeploymentRepository
option.

This also updates the generated POM to be current.
2024-10-10 12:02:42 +02:00

57 lines
1.5 KiB
Groovy

description = "Spring JS Resources"
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")
}
}
}
}
jar {
dependsOn prepareResources
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}