简体   繁体   English

从Github将Android库下载到IntelliJ Idea

[英]Download a Android library from Github to IntelliJ Idea

是否可以从Github将Android库直接下载到IntelliJ Idea 12中的Android项目中?

You can download an Android Library directly into your build by using JitPack . 您可以使用JitPack将Android库直接下载到构建中。 Basically you tell it which repository you want and it will build it for you. 基本上,您告诉它想要的存储库,它将为您构建它。 Once its built you can use the library as a dependency. 构建之后,您可以将库用作依赖项。

If you are using gradle then you'd add this to build.gradle: 如果您使用的是gradle,则可以将其添加到build.gradle中:

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.Owner:Repository:Version'
}

You can also enter the github repo url on the jitpack.io website and it will give you the dependency to paste in your build file. 您还可以在jitpack.io网站上输入github repo url,它将为您提供粘贴到构建文件中的依赖性。

它应适用于库项目的源代码,在项目目录下执行检出,然后在启用了Android facet且“ 是否启用了库项目”选项的情况下为此目录配置一个新模块,然后将此模块作为依赖项添加到主应用程序。

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

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