load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar") _JGIT_VERS = "4.11.0.201803080745-r.2-g61e4f1665" _DOC_VERS = "4.11.0.201803080745-r" # Set to _JGIT_VERS unless using a snapshot JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs" _JGIT_REPO = GERRIT # Leave here even if set to MAVEN_CENTRAL. # set this to use a local version. # "/home//projects/jgit" LOCAL_JGIT_REPO = "" def jgit_repos(): if LOCAL_JGIT_REPO: native.local_repository( name = "jgit", path = LOCAL_JGIT_REPO, ) else: jgit_maven_repos() def jgit_maven_repos(): maven_jar( name = "jgit_lib", artifact = "org.eclipse.jgit:org.eclipse.jgit:" + _JGIT_VERS, repository = _JGIT_REPO, sha1 = "38489eca0a4308087081d07774af86aa6a50b2ab", src_sha1 = "e43c58829c72b5b18e16d1b2bbd1396ddd93098f", unsign = True, ) maven_jar( name = "jgit_servlet", artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS, repository = _JGIT_REPO, sha1 = "f5be45e4f97f0bf0825e4ff8fcb2f47588dd7e92", unsign = True, ) maven_jar( name = "jgit_archive", artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS, repository = _JGIT_REPO, sha1 = "f202f169b2e3a50be90b4123baa941136eda3ed6", ) maven_jar( name = "jgit_junit", artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS, repository = _JGIT_REPO, sha1 = "dd9f7e4cc41b4f47591ce51c4752ccfef012c553", unsign = True, ) def jgit_dep(name): mapping = { "@jgit_junit//jar": "@jgit//org.eclipse.jgit.junit:junit", "@jgit_lib//jar:src": "@jgit//org.eclipse.jgit:libjgit-src.jar", "@jgit_lib//jar": "@jgit//org.eclipse.jgit:jgit", "@jgit_servlet//jar":"@jgit//org.eclipse.jgit.http.server:jgit-servlet", "@jgit_archive//jar": "@jgit//org.eclipse.jgit.archive:jgit-archive", } if LOCAL_JGIT_REPO: return mapping[name] else: return name