| load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_CENTRAL", "MAVEN_LOCAL", "maven_jar") |
| |
| _JGIT_VERS = "4.7.2.201807261330-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, |
| ) |
| 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", |
| ) |
| |
| def jgit_maven_repos(): |
| maven_jar( |
| name = "jgit-lib", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "6c08ef848fa5f7d5d49776fa25ec24d738ee457d", |
| src_sha1 = "ee14417c135693ddc1eebcf23b8cb661c9b8387d", |
| unsign = True, |
| ) |
| maven_jar( |
| name = "jgit-servlet", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "2bde0520c1831eedff5d8e0347e254edc8bf9fa1", |
| unsign = True, |
| ) |
| maven_jar( |
| name = "jgit-archive", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "a0ad9edcd5dc5ba2cf54dfaaa542e520e771d2b8", |
| ) |
| maven_jar( |
| name = "jgit-junit", |
| artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS, |
| repository = _JGIT_REPO, |
| sha1 = "ef8a52ff0a7afcecdb6338b00b03b9a0e0f53dae", |
| 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 |