blob: 8a1ece3c36687fc17e03373a53d958fe069c059c [file] [log] [blame]
load("//tools/bzl:maven_jar.bzl", "MAVEN_CENTRAL", "maven_jar")
_JGIT_VERS = "5.13.2.202306221912-r"
_DOC_VERS = _JGIT_VERS # Set to _JGIT_VERS unless using a snapshot
JGIT_DOC_URL = "https://archive.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,
)
jgit_maven_repos_dev()
else:
jgit_maven_repos()
def jgit_maven_repos_dev():
# Transitive dependencies from JGit's WORKSPACE.
maven_jar(
name = "hamcrest-library",
artifact = "org.hamcrest:hamcrest-library:1.3",
sha1 = "4785a3c21320980282f9f33d0d1264a69040538f",
)
maven_jar(
name = "jzlib",
artifact = "com.jcraft:jzlib:1.1.1",
sha1 = "a1551373315ffc2f96130a0e5704f74e151777ba",
)
def jgit_maven_repos():
maven_jar(
name = "jgit-lib",
artifact = "org.eclipse.jgit:org.eclipse.jgit:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "9821f341f01485ff1d542d7f45c289626059af1f",
src_sha1 = "d27f7e6811bc8a89a3105623f60d48ef7db67e7f",
unsign = True,
)
maven_jar(
name = "jgit-servlet",
artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "e3fd6db40aaaf42e61e717862fd190e8192939e3",
unsign = True,
)
maven_jar(
name = "jgit-archive",
artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "e25fb46d01fa79a6e54c9fe6c78af3255b14dbc8",
)
maven_jar(
name = "jgit-junit",
artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "4d40c40b32c239ef505b0241203980ab0ebad818",
unsign = True,
)
maven_jar(
name = "jgit-ssh-jsch",
artifact = "org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:" + _JGIT_VERS,
repository = _JGIT_REPO,
sha1 = "8a53cebafd3bd55f536552cb022362acf2cca66f",
unsign = True,
)
def jgit_dep(name):
mapping = {
"@jgit-archive//jar": "@jgit//org.eclipse.jgit.archive:jgit-archive",
"@jgit-junit//jar": "@jgit//org.eclipse.jgit.junit:junit",
"@jgit-lib//jar": "@jgit//org.eclipse.jgit:jgit",
"@jgit-lib//jar:src": "@jgit//org.eclipse.jgit:libjgit-src.jar",
"@jgit-servlet//jar": "@jgit//org.eclipse.jgit.http.server:jgit-servlet",
"@jgit-ssh-jsch//jar": "@jgit//org.eclipse.jgit.ssh.jsch:jgit-ssh-jsch",
}
if LOCAL_JGIT_REPO:
return mapping[name]
else:
return name