Skip to content

Instantly share code, notes, and snippets.

@jitpack-io
Created December 7, 2015 13:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jitpack-io/380e88da1a5b3efe695b to your computer and use it in GitHub Desktop.
Save jitpack-io/380e88da1a5b3efe695b to your computer and use it in GitHub Desktop.
JitPack repository in Gradle
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"
}
}
}
}
}
@jitpack-io
Copy link
Author

@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