Created
October 25, 2013 07:03
-
-
Save Lien/7150489 to your computer and use it in GitHub Desktop.
Simple gradle task to create a fatJar that includes all dependencies except for specific jars. Snippet below doesn't include android.jar file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task fatJar(type: Jar, dependsOn: 'compileJava') { | |
from { | |
sourceSets.main.output.classesDir | |
} | |
// Add all dependencies except for android.jar to the fat jar | |
from { | |
configurations.compile.findAll { | |
it.getName() != 'android.jar' | |
}.collect { | |
it.isDirectory() ? it : zipTree(it) | |
} | |
} | |
archiveName = 'fatJar.jar' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment