Move to shadowJar, leaving fatJar behind

- plugin was deprecated
This commit is contained in:
Connor Tumbleson 2017-05-08 08:33:12 -04:00
parent 90b7d4b9b5
commit dfbcf298c2
No known key found for this signature in database
GPG Key ID: C3CC0A201EC7DA75
2 changed files with 8 additions and 14 deletions

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'eu.appsatori.fatjar'
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compile depends.commons_cli
@ -30,22 +30,20 @@ buildscript {
}
}
gradle.taskGraph.whenReady {
fatJar {
jar {
manifest {
attributes("Main-Class": "brut.apktool.Main")
}
attributes 'Main-Class' : 'brut.apktool.Main'
}
}
task cleanOutputDirectory(type: Delete) {
delete fileTree(dir: jar.destinationDir.getPath(), exclude: "apktool-cli.jar")
delete fileTree(dir: jar.destinationDir.getPath(), exclude: "apktool-cli-all.jar")
}
task proguard(type: proguard.gradle.ProGuardTask, dependsOn: fatJar) {
task proguard(type: proguard.gradle.ProGuardTask, dependsOn: shadowJar) {
def outFile = jar.destinationDir.getPath() + '/' + "apktool" + '-' + project.apktool_version + '-small' + '.' + jar.extension
injars fatJar.archivePath
injars shadowJar.archivePath
outjars outFile
libraryjars "${System.properties['java.home']}/lib/rt.jar"
@ -54,7 +52,6 @@ task proguard(type: proguard.gradle.ProGuardTask, dependsOn: fatJar) {
dontoptimize
keep 'public class brut.apktool.Main { public static void main(java.lang.String[]); }'
keep 'class org.yaml.snakeyaml.** { public protected private *; }'
keepclassmembers 'enum * { public static **[] values(); public static ** valueOf(java.lang.String); }'
dontwarn 'com.google.common.base.**'
dontwarn 'com.google.common.collect.**'

View File

@ -21,17 +21,16 @@ buildscript {
options.encoding = "UTF-8"
}
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.3'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}
apply plugin: 'maven'
apply from: 'gradle/functions.gradle'
def apktoolversion_major = '2.2.3'
def apktoolversion_minor = 'SNAPSHOT';
defaultTasks 'build', 'fatJar', 'proguard'
defaultTasks 'build', 'shadowJar', 'proguard'
allprojects {
apply plugin: 'java'
@ -80,8 +79,6 @@ task release {
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
ext {
depends = [