Using gradle with proguard and application plugin


(Brian Huffman) #1

All,

I’m trying to use gradle with a combination of the application plugin and proguard.

Is there a clean way to get the output of the proguard task into the distribution? This is what I’m doing now, but it requires manually setting an extra property to exactly the same thing as outjars:

task obfuscate(type: proguard.gradle.ProGuardTask) {

dependsOn ‘jar’, ‘copyDependencies’

injars jar.archivePath

outjars ‘build/tmp/’ + jar.archiveName

ext.outJar = ‘build/tmp/’ + jar.archiveName }

task createDist(type: Copy) {

into (‘lib’) {

from examplesJar

from obfuscate.outJar

}

}

applicationDistribution.with(createDist)

distTar {

dependsOn ‘obfuscate’

compression = Compression.GZIP }

Thank you, Brian