| load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar") |
| |
| _JGIT_VERS = "4.10.0.201712302008-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 = "61bda423283956d35117a0c1f993e752d12f3132", |
| src_sha1 = "6695024ae412511a5563b68b0df5dde3f765af77", |
| unsign = True, |
| ) |
| maven_jar( |
| name = "jgit_servlet", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "dadd8545b42c47fa1aaa2a53797cb36fa6c91e59", |
| unsign = True, |
| ) |
| maven_jar( |
| name = "jgit_archive", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "8a666fd481124ae34c11dd51955fc0b58644ab4a", |
| ) |
| maven_jar( |
| name = "jgit_junit", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "57f3e31ee3d8ac90d5cd46359111cbb3a4167ebc", |
| 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 |