本文介紹了是否可以在 android gradle 中將 git 存儲庫聲明為依賴項?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我想使用來自 mavencentral 的庫的主版本.
I want to use master version of my lib from mavencentral.
android gradle 中是否可以將 git 倉庫聲明為依賴項?
Is it possible to declare git repository as dependency in android gradle?
推薦答案
對我來說最好的辦法是:
For me the best way is:
https://jitpack.io
步驟 1. 將 JitPack 存儲庫添加到存儲庫末尾的 build.gradle:
Step 1. Add the JitPack repository to build.gradle at the end of repositories:
repositories {
// ...
maven { url "https://jitpack.io" }
}
第二步,在表單中添加依賴
Step 2. Add the dependency in the form
dependencies {
implementation 'com.github.User:Repo:Tag'
}
可以在master分支上構建最新的commit,例如:
It is possible to build the latest commit on the master branch, for example :
dependencies {
implementation 'com.github.jitpack:gradle-simple:master-SNAPSHOT'
}
這篇關于是否可以在 android gradle 中將 git 存儲庫聲明為依賴項?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!