我可以在我发布的 aar 库中包含一个本地模块吗?
Can I include a local module in my published aar library?
我正在做一个有几个模块的项目,像这样:
:app
:coreLib
:exportLibrary
:otherLibrary
在我的 build.gradle
我的 exportLibrary
模块中,我像这样导入 coreLib
:
implementation(project("coreLib"))
在我的应用程序中,我做同样的事情来包含 exportLibrary
:
implementation(project("exportLibrary"))
我想做的是将 exportLibrary
发布到 Maven 存储库,我希望它包含 coreLib
中的所有内容。我还没有找到一个好的方法来做到这一点。添加传递标志没有帮助。我错过了什么?
希望我也不需要发布coreLib
!
我正在使用 artifactoryPublish
发布,其中包括 运行 assembleRelease
之后创建的工件。那么,基本上我如何让 assembleRelease
生成包含我的本地依赖项的二进制文件?
只需在 maven 存储库中发布 coreLibrary
。
然后在您的 exportLibrary
中更改依赖项:
implementation "com.xxxx.coreLibrary:x.y.z"
并在maven中发布。
此时如果你检查回购中 exportLibrary
的 pom 文件,你会发现对 com.xxxx.coreLibrary:x.y.z.
的依赖
我正在做一个有几个模块的项目,像这样:
:app
:coreLib
:exportLibrary
:otherLibrary
在我的 build.gradle
我的 exportLibrary
模块中,我像这样导入 coreLib
:
implementation(project("coreLib"))
在我的应用程序中,我做同样的事情来包含 exportLibrary
:
implementation(project("exportLibrary"))
我想做的是将 exportLibrary
发布到 Maven 存储库,我希望它包含 coreLib
中的所有内容。我还没有找到一个好的方法来做到这一点。添加传递标志没有帮助。我错过了什么?
希望我也不需要发布coreLib
!
我正在使用 artifactoryPublish
发布,其中包括 运行 assembleRelease
之后创建的工件。那么,基本上我如何让 assembleRelease
生成包含我的本地依赖项的二进制文件?
只需在 maven 存储库中发布 coreLibrary
。
然后在您的 exportLibrary
中更改依赖项:
implementation "com.xxxx.coreLibrary:x.y.z"
并在maven中发布。
此时如果你检查回购中 exportLibrary
的 pom 文件,你会发现对 com.xxxx.coreLibrary:x.y.z.