Gleb Stsenov
10/19/2018, 10:05 AMRamon Pires da Silva
10/19/2018, 12:37 PMGleb Stsenov
10/19/2018, 12:47 PMRamon Pires da Silva
10/19/2018, 12:58 PMcorneil
10/21/2018, 8:07 AMGleb Stsenov
10/22/2018, 12:01 PMcorneil
10/24/2018, 4:35 PMrepackage
corneil
10/24/2018, 4:35 PMGleb Stsenov
10/25/2018, 6:10 AMcorneil
10/25/2018, 6:22 AMjar {
enabled=true
archiveName 'myappcode.jar'
}
task proguard(dependsOn: jar) {
ant {
taskdef ... // operate on 'myappcode.jar'
}
}
bootJar.mustRunAfter proguard
This way you can use bootJar normally without invoking proguard but when you need proguard you build ./gradlew proguard bootJar
The archiveName for jar must be different from bootJar so that proguard can modify the correct archive.
You can create an empty file when proguard executed in doLast { new File(project.buildDir, 'proguard.exec').text = 'done' }
and declare is as outputs.files(new File(project.buildDir, 'proguard.exec'))
and inputs.files(new File(project.buildDir, 'myappcode.jar')
then it will only execute when exec is older than myappcode or doesn't exist.corneil
10/25/2018, 6:33 AM