[英]How to edit a gradle dependency
I'm working on an android project that uses the following dependency in my gradle file; 我正在研究一个在我的gradle文件中使用以下依赖项的android项目;
compile 'com.mapzen:on-the-road:1.1.1'
I would like to edit one of the files in order to add some missing features and contribute to the project. 我想编辑其中一个文件,以便添加一些缺少的功能并为项目做出贡献。
How can I download this project and test edits in my android studio project? 如何在我的android studio项目中下载此项目并测试编辑?
I just found out that the project is open-source and is available in Github. 我刚刚发现该项目是开源的,可以在Github上找到。
Please follow these simple steps - 请按照以下简单步骤 -
1) Go to this page and click on "Clone or Download" and then click on "Download ZIP". 1)转到此页面并单击“克隆或下载”,然后单击“下载ZIP”。
2) This will give you the ZIP file which you need to extract to get the entire project. 2)这将为您提供需要提取的ZIP文件以获取整个项目。
3) Now you are free to edit any files in the project you want to. 3)现在您可以自由编辑项目中的任何文件。
4) To include this custom project into your parent project, you need to paste this project into your mail project, include it in the settings.gradle
file like this, 4)要将此自定义项目包含到您的父项目中,您需要将此项目粘贴到您的邮件项目中,将其包含在
settings.gradle
文件中,如下所示,
include ':app', ':customLibrary'
and then you need to compile the library from your app's build.gradle
file, 然后你需要从app的
build.gradle
文件中编译库,
compile project(':customLibrary')
NOTE - Make sure you remove this from the build.gradle file, 注意 - 确保从build.gradle文件中删除它,
compile 'com.mapzen:on-the-road:1.1.1'
When you use dependency, when you build, it downloads the library to : 当您使用依赖项时,在构建时,它会将库下载到:
build -> intermediates -> exploded-aar -> THE_LIBRARY. build - > intermediates - > explosion-aar - > THE_LIBRARY。
If THE_LIBRARY isn't obfuscated, you can take it from there, copy it, and import it as a module to your project(and then edit the class) 如果THE_LIBRARY未被混淆,您可以从那里获取它,复制它,并将其作为模块导入您的项目(然后编辑该类)
On The Road is indeed open source and available on GitHub at https://github.com/mapzen/on-the-road_android . On The Road确实是开源的,可以通过https://github.com/mapzen/on-the-road_android在GitHub上获得。 I am a maintainer for the project.
我是该项目的维护者。 Contributions are always welcome!
欢迎捐款!
Some tips for getting started: 入门的一些提示:
git clone git@github.com:[YOUR_GITHUB_USERNAME]/on-the-road_android.git
. git clone git@github.com:[YOUR_GITHUB_USERNAME]/on-the-road_android.git
将项目克隆到本地计算机git clone git@github.com:[YOUR_GITHUB_USERNAME]/on-the-road_android.git
。 ./gradlew install
. ./gradlew install
将SNAPSHOT部署到本地Maven ./gradlew install
。 This will allow you to test in your app by updating the dependency to compile 'com.mapzen:on-the-road:1.2.0-SNAPSHOT
. compile 'com.mapzen:on-the-road:1.2.0-SNAPSHOT
。 If you do this also make sure your app includes the mavenLocal()
repository in your the repositories
section of the build.gradle
file for your app. build.gradle
文件的repositories
部分中包含mavenLocal()
存储repositories
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.