blob: 9b3eacc3f5422a6e87dcef54401444740a8f5b51 [file] [log] [blame]
David Ostrovskyfa189072016-11-30 08:52:06 +01001load("//lib/jgit:jgit.bzl", "JGIT_DOC_URL")
David Ostrovsky930f29e2019-01-08 23:11:59 +01002load("//lib:guava.bzl", "GUAVA_DOC_URL")
David Ostrovskyfa189072016-11-30 08:52:06 +01003load("//tools/bzl:gwt.bzl", "gwt_module")
David Ostrovsky930f29e2019-01-08 23:11:59 +01004load("//tools/bzl:javadoc.bzl", "java_doc")
Alice Kober-Sotzekbc8186a2016-12-07 14:13:34 +01005load("//tools/bzl:junit.bzl", "junit_tests")
David Ostrovskyb81b4f72016-05-21 19:55:01 +02006
David Ostrovskyfa189072016-11-30 08:52:06 +01007SRC = "src/main/java/com/google/gerrit/extensions/"
David Ostrovskyb81b4f72016-05-21 19:55:01 +02008
David Ostrovskyfa189072016-11-30 08:52:06 +01009EXT_API_SRCS = glob([SRC + "client/*.java"])
David Ostrovskyb81b4f72016-05-21 19:55:01 +020010
11gwt_module(
David Ostrovskyfa189072016-11-30 08:52:06 +010012 name = "client",
13 srcs = EXT_API_SRCS,
14 gwt_xml = SRC + "Extensions.gwt.xml",
15 visibility = ["//visibility:public"],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020016)
17
18java_binary(
David Ostrovskyfa189072016-11-30 08:52:06 +010019 name = "extension-api",
20 main_class = "Dummy",
21 visibility = ["//visibility:public"],
22 runtime_deps = [":lib"],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020023)
24
25java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010026 name = "lib",
27 visibility = ["//visibility:public"],
28 exports = [
29 ":api",
30 "//lib:guava",
31 "//lib:servlet-api-3_1",
32 "//lib/guice",
33 "//lib/guice:guice-assistedinject",
34 "//lib/guice:guice-servlet",
35 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020036)
37
38#TODO(davido): There is no provided_deps argument to java_library rule
39java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010040 name = "api",
41 srcs = glob([SRC + "**/*.java"]),
42 visibility = ["//visibility:public"],
43 deps = [
44 "//gerrit-common:annotations",
45 "//lib:guava",
46 "//lib/guice",
47 "//lib/guice:guice-assistedinject",
48 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020049)
Han-Wen Nienhuyse703f3a2016-08-17 17:05:44 +020050
Alice Kober-Sotzekbc8186a2016-12-07 14:13:34 +010051junit_tests(
52 name = "api_tests",
53 srcs = glob(["src/test/java/**/*Test.java"]),
54 deps = [
55 ":api",
56 "//gerrit-test-util:test_util",
57 "//lib:truth",
58 "//lib/guice",
59 ],
60)
61
Han-Wen Nienhuyse703f3a2016-08-17 17:05:44 +020062java_doc(
David Ostrovskyfa189072016-11-30 08:52:06 +010063 name = "extension-api-javadoc",
64 external_docs = [
65 JGIT_DOC_URL,
66 GUAVA_DOC_URL,
67 ],
68 libs = [":api"],
69 pkgs = ["com.google.gerrit.extensions"],
70 title = "Gerrit Review Extension API Documentation",
71 visibility = ["//visibility:public"],
Han-Wen Nienhuyse703f3a2016-08-17 17:05:44 +020072)