makeJar

task makeJar(type: Jar) {    //指定生成的jar名    baseName 'plugin'    //从哪里打包class文件    from('build/intermediates/classes/debug/com/xhrd/mobile/hybridframework/plugin/')    //打包到jar后的目录结构    into('com/xhrd/mobile/hybridframework/plugin/')    //去掉不须要打包的目录和文件    exclude('test/', 'BuildConfig.class', 'R.class')    //去掉R$开头的文件    exclude{ it.name.startsWith('R$');}}task makeJar2(type: Jar){    archiveName = "myJarName.jar"    from('build/intermediates/classes/debug/com/xhrd/mobile/hybridframework/plugin/'){        exclude('BuildConfig.class', 'R.class')        //去掉R$开头的文件        exclude{ it.name.startsWith('R$');}    }    //打包到jar后的目录结构    into('com/xhrd/mobile/hybridframework/plugin/')}http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradlehttp://www.alloyteam.com/2015/03/shi-yong-gradle-da-bao-zhi-ding-bao-ming-he-lei-di-jar/
相关文章
相关标签/搜索