本文介紹了是否可以在 android gradle 中將 git 存儲(chǔ)庫(kù)聲明為依賴項(xiàng)?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!
問(wèn)題描述
我想使用來(lái)自 mavencentral 的庫(kù)的主版本.
I want to use master version of my lib from mavencentral.
android gradle 中是否可以將 git 倉(cāng)庫(kù)聲明為依賴項(xiàng)?
Is it possible to declare git repository as dependency in android gradle?
推薦答案
對(duì)我來(lái)說(shuō)最好的辦法是:
For me the best way is:
https://jitpack.io
步驟 1. 將 JitPack 存儲(chǔ)庫(kù)添加到存儲(chǔ)庫(kù)末尾的 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分支上構(gòu)建最新的commit,例如:
It is possible to build the latest commit on the master branch, for example :
dependencies {
implementation 'com.github.jitpack:gradle-simple:master-SNAPSHOT'
}
這篇關(guān)于是否可以在 android gradle 中將 git 存儲(chǔ)庫(kù)聲明為依賴項(xiàng)?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!