| load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar") |
| |
| _JGIT_VERS = "4.7.0.201704051617-r.15-gc4e952109" |
| |
| _DOC_VERS = "4.7.0.201704051617-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 = "875277521153030e2bdab12bf602b740232b2b28", |
| src_sha1 = "f9adcd3ef0f77c5db16569771f95bc0142c36f46", |
| unsign = True, |
| ) |
| maven_jar( |
| name = "jgit_servlet", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "e1037f50696a6e19fb5d30f9d44cb31e3c5fe8b0", |
| unsign = True, |
| ) |
| maven_jar( |
| name = "jgit_archive", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "660bc82c9ff3c33249d269860d9793e830d6c374", |
| ) |
| maven_jar( |
| name = "jgit_junit", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "c2b28646cc2531df947a9e0f73fa9c415567b05e", |
| 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 |