Android Gradle依赖分叉的GitHub项目 [英] Android Gradle dependency on a forked GitHub project

查看:107
本文介绍了Android Gradle依赖分叉的GitHub项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将第三方自定义ListView库引入我的Android Gradle项目。我最初将该项目添加为jcenter回购库中的一个gradle库依赖项。但现在我分叉了GitHub项目,并且正在对其进行更改。

I've pulled in a third party custom ListView library into my Android Gradle project. I initially added the project as a gradle library dependency from the jcenter repo. But now I forked the GitHub project and I'm making changes to it.

原始项目已不再维护,因此提交拉取请求不起作用,我真的需要自己的fork。

The original project is no longer maintained, so submitting a pull request is not going to work, I really need my own fork.

使用Gradle设置这个依赖的好方法是什么?

What would be a nice way to set this dependency up using Gradle?

我想把ListView库放到与我的项目相同的GitHub仓库中,但是这看起来很麻烦,我想把我的fork作为一个单独的库。

I thought of putting the ListView library under the same GitHub repo as my project, but that seems messy, I do want to keep my fork as a separate library.

另一个我想过的事情是在同一级别检查它们,并在我的Gradle配置中使用..从我的应用程序到达库。这意味着如果我有一个合作者(我可能会很快),他们或者需要调整配置以适应他们,或者像我一样查看事情。

Another thing I thought about was checking them both out at the same level, and using ".." in my Gradle config to get to the library from my app. This means that if I have a collaborator (and I may soon) they either need to tweak the config to suit them or check things out in the same way I did.

或者我可以发布到像mavenCentral或jcenter这样的回购站,但我仍在努力,所以这听起来也不错。

Or I could publish to a repo like mavenCentral or jcenter, but I'm still working on it, so that doesn't sound good either.

是否有更清洁的选项我错过了什么?

Is there a cleaner option that I'm missing?

推荐答案

简单的解决方案是使用 JitPack 。你只需要创建一个GitHub版本并在版本库中创建一个构建文件。

A simple solution would be to publish your library with JitPack. You just would need to create a GitHub release and have a build file in your repository.

JitPack是一个从GitHub存储库中获取包的Maven存储库。它检出你的代码并构建它。

JitPack is a maven repository that pulls in packages from GitHub repositories. It checks out your code and builds it.

这篇关于Android Gradle依赖分叉的GitHub项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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