Gradle把相关依赖(dependencies)打成FatJar方法

为什么80%的码农都做不了架构师?>>>   hot3.png

task buildFatJar(dependsOn: ['compileReleaseJavaWithJavac'], type: Jar) {
    archiveName = 'test.jar'
    from('build/intermediates/classes/release')
    from(configurations.compile.collect {
        it.isDirectory() ? it : project.zipTree(it).collect {
            it.name.endsWith(".jar") ? project.zipTree(it) : it
        }
    })
    destinationDir = file('build/libs')
    include('sample/process/**/*.class', 'com/google/android/gms/**/*.class')
}

 

转载于:https://my.oschina.net/hanoi/blog/1928477

你可能感兴趣的:(Gradle把相关依赖(dependencies)打成FatJar方法)