David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 1 | load("//lib/jgit:jgit.bzl", "JGIT_DOC_URL") |
David Ostrovsky | 930f29e | 2019-01-08 23:11:59 +0100 | [diff] [blame] | 2 | load("//lib:guava.bzl", "GUAVA_DOC_URL") |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 3 | load("//tools/bzl:gwt.bzl", "gwt_module") |
David Ostrovsky | 930f29e | 2019-01-08 23:11:59 +0100 | [diff] [blame] | 4 | load("//tools/bzl:javadoc.bzl", "java_doc") |
Alice Kober-Sotzek | bc8186a | 2016-12-07 14:13:34 +0100 | [diff] [blame] | 5 | load("//tools/bzl:junit.bzl", "junit_tests") |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 6 | |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 7 | SRC = "src/main/java/com/google/gerrit/extensions/" |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 8 | |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 9 | EXT_API_SRCS = glob([SRC + "client/*.java"]) |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 10 | |
| 11 | gwt_module( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 12 | name = "client", |
| 13 | srcs = EXT_API_SRCS, |
| 14 | gwt_xml = SRC + "Extensions.gwt.xml", |
| 15 | visibility = ["//visibility:public"], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 16 | ) |
| 17 | |
| 18 | java_binary( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 19 | name = "extension-api", |
| 20 | main_class = "Dummy", |
| 21 | visibility = ["//visibility:public"], |
| 22 | runtime_deps = [":lib"], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 23 | ) |
| 24 | |
| 25 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 26 | 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 Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 36 | ) |
| 37 | |
| 38 | #TODO(davido): There is no provided_deps argument to java_library rule |
| 39 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 40 | 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 Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 49 | ) |
Han-Wen Nienhuys | e703f3a | 2016-08-17 17:05:44 +0200 | [diff] [blame] | 50 | |
Alice Kober-Sotzek | bc8186a | 2016-12-07 14:13:34 +0100 | [diff] [blame] | 51 | junit_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 Nienhuys | e703f3a | 2016-08-17 17:05:44 +0200 | [diff] [blame] | 62 | java_doc( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 63 | 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 Nienhuys | e703f3a | 2016-08-17 17:05:44 +0200 | [diff] [blame] | 72 | ) |