简体   繁体   English

创建一个具有多个 aar 文件作为依赖项的 aar

[英]Create an aar which has multiple aar files as dependencies

I am trying to build an sdk which has more than one aar as dependencies.我正在尝试构建一个具有多个 aar 作为依赖项的 sdk。 I like to ship my sdk as one aar.我喜欢将我的 sdk 作为一个 aar 运送。 so the structure would be所以结构将是

ProjectFolder项目文件夹
| |
+--AndroidLibs +--AndroidLibs
| | | |
| | +--lib 1(android library - AAR) +--lib 1(安卓库-AAR)
| | | |
| | +--lib 2(android library - AAR) +--lib 2(安卓库-AAR)
| |
| |
+--SDK(depends on lib 1 and lib 2) +--SDK(依赖于 lib 1 和 lib 2)
| |
+--APP(depends on SDK) +--APP(取决于SDK)

There is no support for merging multiple AARs into a single AAR.不支持将多个 AAR 合并为一个 AAR。

The solution is to manually add the dependencies of the library you want to use or publish your artifacts on jCenter or Maven and define your dependencies rules in their .pom files解决方案是手动添加您要使用的库的依赖项或在 jCenter 或 Maven 上发布您的工件,并在其.pom文件中定义您的依赖项规则

Even though there is no any official Gradle support for this, you can use a plugin for this.即使对此没有任何官方 Gradle 支持,您也可以为此使用插件。 An example plugin: https://github.com/Mobbeel/fataar-gradle-plugin一个示例插件: https : //github.com/Mobbeel/fataar-gradle-plugin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM