简体   繁体   English

导出Android库 - Android Studio

[英]Exporting Android Library - Android Studio

I created an Android Library in Android studio. 我在Android工作室创建了一个Android库。 I now want to make it available for others to use it. 我现在想让其他人使用它。 It uses Google Play Services and a drawable (drawable isnt necessary). 它使用Google Play服务和drawable(不需要绘图)。 My issue is I can only find reading on importing libraries, not exporting them. 我的问题是我只能找到关于导入库的阅读,而不是导出它们。

I want to make this library downloadable. 我想让这个库可以下载。 Does anyone have steps to exporting it and packaging it so people can reference it in a build.gradle file. 有没有人有步骤导出它并打包它,以便人们可以在build.gradle文件中引用它。

Thanks in advance. 提前致谢。

Jitpack is probably the easiest method of publishing artefacts, assuming your repository is on Github. 假设您的存储库位于Github上, Jitpack可能是发布文物的最简单方法。 All you need to do is alter the build.gradle in the project referencing the library to something like below, then sync your gradle files: 您需要做的就是将引用库的项目中的build.gradle更改为如下所示,然后同步您的gradle文件:

repositories {
        maven { url "https://jitpack.io" }
    }
    dependencies {
        compile 'com.github.MyUser:MyRepo:-SNAPSHOT'
    }

Behind the scenes this results in Jitpack grabbing the library source from Github, building it, then allowing you to download it. 在幕后,这导致Jitpack从Github获取库源,构建它,然后允许您下载它。 It's possible to specify releases by using tags in Github - the example given just uses the latest commit. 可以通过在Github中使用标记来指定版本 - 给出的示例只使用最新的提交。

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

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