blob: ba34750dbfd34adf73e07f5fdcfd812a1c6bd88e [file] [log] [blame]
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_CENTRAL", "MAVEN_LOCAL", "maven_jar")
_JGIT_VERS = "5.0.2.201807311906-r"
_DOC_VERS = _JGIT_VERS # Set to _JGIT_VERS unless using a snapshot
JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs"
_JGIT_REPO = MAVEN_CENTRAL # Leave here even if set to MAVEN_CENTRAL.
# set this to use a local version.
# "/home/<user>/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 = "a81d7c8d153a8a744b6be1d9c6d698270beec1c0",
src_sha1 = "c89f8f38cebaf75d13f9b2f7a1da71206d8c38f7",
unsign = True,
)
maven_jar(
name = "jgit-servlet",
artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "ab3d0c85bc2008da513c1127ab4acf3df8ef414e",
unsign = True,
)
maven_jar(
name = "jgit-archive",
artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "ba6e0aaf3f733f2f460e227145526e1737ca160f",
)
maven_jar(
name = "jgit-junit",
artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "fe28963520e19c918eb26747e678ec9772ba800f",
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