[英]Include /libs/ folder in aar
Feel like Im going mad here - this must be so simple! 感觉我在这里疯了-这一定很简单!
I have an android aar which I have built from gradle assembleRelease
and also using the maven-publish
plugin. 我有一个我从gradle assembleRelease
构建的android aar,也使用了maven-publish
插件。 I thought that /libs/ was included by default but evidently not. 我认为/ libs /是默认包含的,但显然不是。
Android tools site shows its an optional include Android工具网站显示了其可选的包含
http://tools.android.com/tech-docs/new-build-system/aar-format http://tools.android.com/tech-docs/new-build-system/aar-format
but for the life of me I don't see where this is configured. 但对于我的一生,我看不到它的配置位置。
I have asked a related Q Include folder in Gradle artifact but I dont see this as a duplicate as thats a generic gradle question really whereas this is aar specific and may be solved outside of gradle. 我在Gradle工件中询问了一个相关的Q Include文件夹,但我不认为这是重复的,因为那确实是一个通用gradle问题,而这是特定于aar的,可以在gradle之外解决。
Edit I have also asked on the Gradle forum 编辑我也在Gradle论坛上问过
The aar packages local libraries in libs/
so you need to have local jar dependencies. aar在libs/
打包本地库,因此您需要具有本地jar依赖项。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
}
When the maven
plugin runs uploadArchives
then it will create a pom
file that tells maven
or gradle
what dependencies your aar
needs. 当maven
插件运行uploadArchives
,它将创建一个pom
文件,该文件告诉maven
或gradle
您的aar
需要什么依赖关系。 Gradle will handle downloading the jar
files and placing them in your class path for the build. Gradle将处理下载jar
文件并将其放置在构建的类路径中。
I commented on your other question as well 我也评论了你的其他问题
*reference: https://maven.apache.org/pom.html#Dependencies *参考: https : //maven.apache.org/pom.html#Dependencies
*=gradle is backed by maven for dependency management so artifacts available to maven are also available to gradle and vice versa * = gradle由maven支持以进行依赖关系管理,因此maven可用的工件也可以进行gradle,反之亦然
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.