Created
December 7, 2015 13:29
-
-
Save jitpack-io/380e88da1a5b3efe695b to your computer and use it in GitHub Desktop.
JitPack repository in Gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import org.gradle.api.artifacts.dsl.RepositoryHandler | |
apply plugin:JitPackRepositoryPlugin | |
class JitPackRepositoryPlugin implements Plugin<Gradle> { | |
void apply(Gradle gradle) { | |
gradle.allprojects { project -> | |
project.repositories.metaClass.jitpack = { String org = null, String subPattern = null, def closure = null -> | |
delegate.maven { | |
url "https://jitpack.io" | |
} | |
} | |
} | |
} | |
} |
@vignesh-iopex Thanks for the tip! Not sure how to make it work with buildscript repositories. It's probably a matter of finding the right api so might be an idea to ask in Gradle forums.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This registers
jitpack
only to project repositories, any idea how to get this working for buildscript repositories, couldn't get it to work for the following code.Adding the following line to $HOME/.gradle/init.gradle will do the work