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

Alexey Zakharov picture Alexey Zakharov · Sep 11, 2013 · Viewed 52.9k times · Source

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

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

Answer

sunnyday picture sunnyday · Sep 20, 2015

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'
}