Is it possible to declare git repository as dependency in android gradle?

后端 未结 5 456
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 19:27

I want to use master version of my lib from mavencentral.

Is it possible to declare git repository as dependency in android gradle?

5条回答
  •  鱼传尺愫
    2020-11-30 19:42

    For me the best way is:

    https://jitpack.io

    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 {
        compile 'com.github.User:Repo:Tag'
    }
    

    It is possible to build the latest commit on the master branch, for example :

    dependencies {
        compile 'com.github.jitpack:gradle-simple:master-SNAPSHOT'
    }
    

提交回复
热议问题