android gradle 3.0前打包jar

//打jar包

def SDK_BASENAME = "xxsdk";

def sdkJarPath = "build";

def SDK_VERSION = "_v1.0.0";

//gradle 3.0之前

def zipFile = file('build/intermediates/bundles/release/classes.jar')

//新建一个任务task

task makeJar(type: Jar) {

    //拿到jar

        from zipTree(zipFile)

    //拿到项目目录的assets资源文件

        from fileTree(dir: 'src/main', includes: ['assets/**'])

//命名

        baseName = SDK_BASENAME + SDK_VERSION

//jar 跟 assets一起打包

        destinationDir = file("build")

}

makeJar.dependsOn(build)

你可能感兴趣的:(android gradle 3.0前打包jar)