-
Notifications
You must be signed in to change notification settings - Fork 7
/
gerrit_api.bzl
50 lines (45 loc) · 1.78 KB
/
gerrit_api.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
load("//:bouncycastle.bzl", "bouncycastle_repos")
load("//:gerrit_api_version.bzl", "gerrit_api_version")
load("//:rules_python.bzl", "rules_python_repos")
load("//tools:maven_jar.bzl", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar")
"""Bazel rule for building [Gerrit Code Review](https://www.gerritcodereview.com/)
gerrit_api is rule for fetching Gerrit plugin API using Bazel.
"""
def gerrit_api(version = "3.10.0",
plugin_api_sha1 = "3064f8d684490b412c136f88eacf95d1a067aec6",
acceptance_framework_sha1 = "9f90d5a30f60d18039c63c328cd8349807c9a313"):
gerrit_api_version(
name = "gerrit_api_version",
version = version,
)
bouncycastle_repos()
rules_python_repos()
local_repository = version.endswith("-SNAPSHOT")
maven_jar(
name = "gerrit_plugin_api",
artifact = "com.google.gerrit:gerrit-plugin-api:" + version,
sha1 = "" if local_repository else plugin_api_sha1,
repository = MAVEN_LOCAL if local_repository else MAVEN_CENTRAL,
)
maven_jar(
name = "gerrit_acceptance_framework",
artifact = "com.google.gerrit:gerrit-acceptance-framework:" + version,
sha1 = "" if local_repository else acceptance_framework_sha1,
repository = MAVEN_LOCAL if local_repository else MAVEN_CENTRAL,
)
native.bind(
name = "gerrit-plugin-api",
actual = "@gerrit_plugin_api//jar",
)
native.bind(
name = "gerrit-acceptance-framework",
actual = "@gerrit_acceptance_framework//jar",
)
native.bind(
name = "gerrit-plugin-api-neverlink",
actual = "@gerrit_plugin_api//jar:neverlink",
)
native.bind(
name = "gerrit-acceptance-framework-neverlink",
actual = "@gerrit_acceptance_framework//jar:neverlink",
)