
Same upstream changes as in Ifa305e7, but based on JGit master instead of stable. Change-Id: Icb9e65fa672850109969356a87d994002486a0b8
67 lines
2.1 KiB
Python
67 lines
2.1 KiB
Python
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar")
|
|
|
|
_JGIT_VERS = "4.9.0.201710071750-r.30-g651e17bac"
|
|
|
|
_DOC_VERS = "4.9.0.201710071750-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/<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 = "5f0ab69e6dd369c9efcf2fc23f7ae923113d6d3d",
|
|
src_sha1 = "8dcfff9612815fc1b2bb0e8d032c9b99a6ed89e4",
|
|
unsign = True,
|
|
)
|
|
maven_jar(
|
|
name = "jgit_servlet",
|
|
artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS,
|
|
repository = _JGIT_REPO,
|
|
sha1 = "58629a74278c502f7fb6926b9a4b483da46072b5",
|
|
unsign = True,
|
|
)
|
|
maven_jar(
|
|
name = "jgit_archive",
|
|
artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS,
|
|
repository = _JGIT_REPO,
|
|
sha1 = "a31a98bac30977bbad867aa89a0338d3260eb46a",
|
|
)
|
|
maven_jar(
|
|
name = "jgit_junit",
|
|
artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS,
|
|
repository = _JGIT_REPO,
|
|
sha1 = "358989980e6faf77c3af955f5eea268020a6407d",
|
|
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
|