Android Studio 将引用第三方jar包, Android工程的assets下的文件与Android工程一起打包成jar包

def zipFile = file('build/intermediates/bundles/release/classes.jar')
def jarName = "test";

task makeJar1(type: Jar) {
    delete 'libs/test.jar'
    from zipTree(zipFile)
    //下面的方法将assets文件夹下资源一起打进jar包中
    from fileTree(dir: 'src/main', includes: ['assets/**'])
   //下面这是将第三方jar一起打包进入我这个test包的
    from zipTree("libs/t*s_***_sdk_151115.jar") 
    baseName = jarName
    destinationDir = file('libs/')
}
makeJar1.dependsOn(build)
//在终端执行生成JAR包,在Terminal窗口输入下面一句话
// gradlew makeJar1

你可能感兴趣的:(android)