打包具有依赖项的Android AAR

编程入门 行业动态 更新时间:2024-10-24 15:16:04
本文介绍了打包具有依赖项的Android AAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将我的图书馆打包成aar.

I want to package my library as an aar.

该库具有多个依赖项(通用图像加载器,ORMLite,番石榴...)

The library has several dependencies (universal image loader, ORMLite, guava...)

它也依赖于我编写的另一个库(称为库B").

It also has a dependency for another library that I wrote (call it 'library B').

我有2个问题:

  • 将要使用我的库的每个人都需要根据库的依赖项(通用图像加载器,ORMLite,番石榴...)添加依赖项
  • 我是否需要为库B"创建一个单独的aar,并且我的lib用户是否对此具有单独的依赖关系?
  • 推荐答案

    将要使用我的库的每个人都需要根据库的依赖项(通用图像加载器,ORMLite,番石榴...)添加依赖项

    Will everyone who will use my library need to add dependencies according to the library's dependencies (universal image loader, ORMLite, guava...)

    如果您将AAR作为工件以适当的元数据(例如Maven样式的POM文件)在存储库中分发,则不会.元数据将指向您的依赖关系,而构建系统(例如Gradle)将获取依赖关系.

    Not if you are distributing your AAR as an artifact in a repository with appropriate metadata (e.g., Maven-style POM file). The metadata will point to your dependencies, and build systems (e.g., Gradle) will pull in the dependencies.

    我需要为库B"创建一个单独的aar吗?

    Do I need to create a separate aar for 'library B'

    是的,否则除非您消除它并将其代码折叠到您的第一个库中,否则没有人可以访问它.

    Yes, otherwise nobody will have access to it, unless you eliminate it and fold its code into your first library.

    我的lib用户是否有单独的依赖项?

    and have users of my lib have a separate dependency for it?

    有关设置依赖性的信息,请参见上文.

    See above for setting up dependencies.

    更多推荐

    打包具有依赖项的Android AAR

    本文发布于:2023-08-02 11:46:23,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1277544.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:Android   AAR

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!