I’m trying to create a configuration to define an obfuscated jar produced by a proguard task as an artifact.
I’d like to only refer to the task producing the jar rather than the path itself but I’ve realised that ProguardTask is not an ArchiveTask. Is there any way to avoid hard-coding the path in the artifacts section?
This is what I would like to have but it doesn’t work:
configurations {
obfuscatedArchive
}
task obfuscate(type: ProguardTask) {
injars tasks.jar
outjars "$buildDir/obfuscated-app.jar"
....
}
artifacts {
obfuscatedArchive obfuscate
}