task makeJar(type: Jar, dependsOn: "assembleRelease") {
doFirst {
delete fileTree(BUILD_LIBS_PATH) {
include JAR_NAME_PREFIX + "**.jar"
}
}
archiveName = 'kkcoresdk.jar'
from('build/intermediates/classes/release')
from(project.zipTree("libs/app_kookong_data.jar"))
from(project.zipTree("libs/app_service.jar"))
from(project.zipTree("libs/xutils.jar"))
destinationDir = file('build/libs')
// exclude('com/kookong/sdk/BuildConfig.class')
exclude('com/kookong/sdk/BuildConfig\$*.class')
exclude('**/R.class')
exclude('**/R\$*.class')
}
1.定义打包jar的task
2.设置打包class的目录
3.编译所依赖的jar
4.指定输出路径