如何让您在Github上库可导入到Android工作室 [英] How to make your library in Github importable to Android studio

查看:187
本文介绍了如何让您在Github上库可导入到Android工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,你可以用摇篮导入Github上图书馆机器人工作室:

I know that you can import Github libraries in android studios using Gradle:

compile 'com.github.someone.something:xxx-yyy:+'

什么是部分: XXX-YYY:+ ?如何构建这个项目,以便它可以用previous线导入?

What is that part: xxx-yyy:+ ? How do I build the project so that it can be imported with the previous line?

到目前为止,如果我只是上传一个库,导入没有去年XXX,YYY:+,我得到一个错误,这是一个无效的描述。如果我写一个版本,然后我得到一个错误,指出它无法找到

So far if I just upload a library and import it without that last xxx-yyy:+, I get an error that it is an invalid description. If I write a version then I get an error saying that it can't be found

推荐答案

这是所有通过的Maven用摇篮的Maven插件的方式处理。

This is all handled via Maven by way of Gradle's Maven Plugin.

这是显而易见的,你已经掌握某人是GitHub的用户有什么东西是他们回购的叉。

It's apparent that you've already grasped that someone is the Github user and something is their fork of the repo.

下面是对Maven依赖的文件(这是比较容易找到,这是一样的编译)

Here's the documentation for Maven dependency (it was easier to find and it is the same as compile)

http://maven.apache.org/plugins/ Maven的编译器插件/依存,在info.html

http://maven.apache.org/plugins/maven-compiler-plugin/dependency-info.html

中的xxx-yyy是的artifactId。 + - [A-ZA-Z0-9 _ \\。]:Maven的神器标识必须此正则表达式匹配。需要注意的是神器ID甚至不需要破折号。这可能仅仅是库。

The xxx-yyy is the artifactId. Maven artifact IDs must match this regex: [A-Za-z0-9_\-.]+. Note that the artifact ID doesn't even need the dash. It could just be "library".

最后,最后一位是版本(我相信这是在Github上标记)。 +表示你想要最新的,但你可以指定一个特定版本。

Finally the last bit is the version (I believe this is the tag in Github). + indicates you want the latest, but you could specify a specific version.

这篇关于如何让您在Github上库可导入到Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆