Android多模块构建合并aar解决方案fat-aar-android

apply plugin: 'com.kezong.fat-aar'  

embed project(path: ':lib-java')

原文来自fat-aar-android/README_CN.md at master · kezong/fat-aar-android · GitHubA gradle plugin that merge dependencies into the final aar file works with AGP 3.+ - fat-aar-android/README_CN.md at master · kezong/fat-aar-androidhttps://github.com/kezong/fat-aar-android/blob/master/README_CN.md

远程依赖

如果你想将所有远程依赖在pom中声明的依赖项同时打入在最终产物里的话,你需要在build.gradle中将transitive值改为true,例如:

fataar {
    /**
     * If transitive is true, local jar module and remote library's dependencies will be embed.
     * If transitive is false, just embed first level dependency
     * Local aar project does not support transitive, always embed first level
     * Default value is false
     * @since 1.3.0
     */
    transitive = true
}

如果你将transitive的值改成了true,并且想忽略pom文件中的某一个依赖项,你可以添加exclude关键字,例如:

embed('com.facebook.fresco:fresco:1.11.0') {
    // exclude any group or module
    exclude(group:'com.facebook.soloader', module:'soloader')
    // exclude all dependencies
    transitive = false
}

 


版权声明:本文为NiuAGeNiuC原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。