I want to use master version of my lib from mavencentral.
Is it possible to declare git repository as dependency in android gradle?
There is now a new feature in gradle that lets you add source dependencies from git.
You first need to define the repo in the settings.gradle
file and map it to a module identifier:
sourceControl {
gitRepository("https://github.com/gradle/native-samples-cpp-library.git") {
producesModule("org.gradle.cpp-samples:utilities")
}
}
And now in your build.gradle
you can point to a specific tag (e.g.: 'v1.0'):
dependencies {
...
implementation 'org.gradle.cpp-samples:utilities:v1.0'
}
Or to a specific branch:
dependencies {
...
implementation('org.gradle.cpp-samples:utilities') {
version {
branch = 'release'
}
}
}
Caveats:
References: