blob: a382fbfd12349ca200abd829ebf2e3dc4e8d2329 [file] [log] [blame]
David Ostrovskyfa189072016-11-30 08:52:06 +01001load("//tools/bzl:java.bzl", "java_library2")
2load("//tools/bzl:junit.bzl", "junit_tests")
3load("//tools/bzl:license.bzl", "license_test")
David Ostrovskyb81b4f72016-05-21 19:55:01 +02004
David Ostrovskyfa189072016-11-30 08:52:06 +01005SRCS = "src/main/java/com/google/gerrit/pgm/"
David Ostrovskyb81b4f72016-05-21 19:55:01 +02006
David Ostrovskyfa189072016-11-30 08:52:06 +01007RSRCS = "src/main/resources/com/google/gerrit/pgm/"
8
9INIT_API_SRCS = glob([SRCS + "init/api/*.java"])
David Ostrovskyb81b4f72016-05-21 19:55:01 +020010
11BASE_JETTY_DEPS = [
David Ostrovskyfa189072016-11-30 08:52:06 +010012 "//gerrit-common:server",
13 "//gerrit-extension-api:api",
14 "//gerrit-gwtexpui:linker_server",
15 "//gerrit-gwtexpui:server",
16 "//gerrit-httpd:httpd",
17 "//gerrit-server:server",
18 "//gerrit-sshd:sshd",
19 "//lib:guava",
20 "//lib/guice:guice",
21 "//lib/guice:guice-assistedinject",
22 "//lib/guice:guice-servlet",
23 "//lib/jgit/org.eclipse.jgit:jgit",
24 "//lib/joda:joda-time",
25 "//lib/log:api",
26 "//lib/log:log4j",
David Ostrovskyb81b4f72016-05-21 19:55:01 +020027]
28
29DEPS = BASE_JETTY_DEPS + [
David Ostrovskyfa189072016-11-30 08:52:06 +010030 "//gerrit-reviewdb:server",
31 "//lib/log:jsonevent-layout",
David Ostrovskyb81b4f72016-05-21 19:55:01 +020032]
33
34java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010035 name = "init-api",
36 srcs = INIT_API_SRCS,
37 visibility = ["//visibility:public"],
38 deps = DEPS + ["//gerrit-common:annotations"],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020039)
40
41java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010042 name = "init",
43 srcs = glob([SRCS + "init/*.java"]),
44 resources = glob([RSRCS + "init/*"]),
45 visibility = ["//visibility:public"],
46 deps = DEPS + [
47 ":init-api",
48 ":util",
49 "//gerrit-common:annotations",
50 "//gerrit-launcher:launcher", # We want this dep to be provided_deps
51 "//gerrit-lucene:lucene",
52 "//lib:args4j",
53 "//lib:derby",
54 "//lib:gwtjsonrpc",
55 "//lib:gwtorm",
56 "//lib:h2",
57 "//lib/commons:validator",
58 "//lib/mina:sshd",
59 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020060)
61
62REST_UTIL_DEPS = [
David Ostrovskyfa189072016-11-30 08:52:06 +010063 "//gerrit-cache-h2:cache-h2",
64 "//gerrit-util-cli:cli",
65 "//lib:args4j",
66 "//lib:gwtorm",
67 "//lib/commons:dbcp",
David Ostrovskyb81b4f72016-05-21 19:55:01 +020068]
69
70java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010071 name = "util",
72 visibility = ["//visibility:public"],
73 exports = [":util-nodep"],
74 runtime_deps = DEPS + REST_UTIL_DEPS,
David Ostrovskyb81b4f72016-05-21 19:55:01 +020075)
76
77java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010078 name = "util-nodep",
79 srcs = glob([SRCS + "util/*.java"]),
80 visibility = ["//visibility:public"],
81 deps = DEPS + REST_UTIL_DEPS, # We want all these deps to be provided_deps
David Ostrovskyb81b4f72016-05-21 19:55:01 +020082)
83
84JETTY_DEPS = [
David Ostrovskyfa189072016-11-30 08:52:06 +010085 "//lib/jetty:jmx",
86 "//lib/jetty:server",
87 "//lib/jetty:servlet",
David Ostrovskyb81b4f72016-05-21 19:55:01 +020088]
89
90java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010091 name = "http",
92 visibility = ["//visibility:public"],
93 exports = [":http-jetty"],
94 runtime_deps = DEPS + JETTY_DEPS,
David Ostrovskyb81b4f72016-05-21 19:55:01 +020095)
96
97java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010098 name = "http-jetty",
99 srcs = glob([SRCS + "http/jetty/*.java"]),
100 visibility = ["//visibility:public"],
101 deps = JETTY_DEPS + BASE_JETTY_DEPS + [
102 # We want all these deps to be provided_deps
103 "//gerrit-launcher:launcher",
104 "//gerrit-reviewdb:client",
105 "//lib:servlet-api-3_1",
106 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +0200107)
108
109REST_PGM_DEPS = [
David Ostrovskyfa189072016-11-30 08:52:06 +0100110 ":http",
111 ":init",
112 ":init-api",
113 ":util",
114 "//gerrit-cache-h2:cache-h2",
115 "//gerrit-elasticsearch:elasticsearch",
116 "//gerrit-gpg:gpg",
117 "//gerrit-lucene:lucene",
118 "//gerrit-oauth:oauth",
119 "//gerrit-openid:openid",
120 "//lib:args4j",
121 "//lib:gwtorm",
122 "//lib:protobuf",
123 "//lib:servlet-api-3_1-without-neverlink",
124 "//lib/prolog:cafeteria",
125 "//lib/prolog:compiler",
126 "//lib/prolog:runtime",
David Ostrovskyb81b4f72016-05-21 19:55:01 +0200127]
128
129java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +0100130 name = "pgm",
131 resources = glob([RSRCS + "*"]),
132 visibility = ["//visibility:public"],
133 runtime_deps = DEPS + REST_PGM_DEPS + [
134 ":daemon",
135 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +0200136)
137
138# no transitive deps, used for gerrit-acceptance-framework
139java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +0100140 name = "daemon",
141 srcs = glob([
142 SRCS + "*.java",
143 SRCS + "rules/*.java",
144 ]),
145 resources = glob([RSRCS + "*"]),
146 visibility = ["//visibility:public"],
147 deps = DEPS + REST_PGM_DEPS + [
148 # We want all these deps to be provided_deps
149 "//gerrit-launcher:launcher",
150 "//lib/auto:auto-value",
151 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +0200152)
153
154junit_tests(
David Ostrovskyfa189072016-11-30 08:52:06 +0100155 name = "pgm_tests",
156 srcs = glob(["src/test/java/**/*.java"]),
157 deps = [
158 ":init",
159 ":init-api",
160 ":pgm",
161 "//gerrit-common:server",
162 "//gerrit-server:server",
163 "//lib:guava",
164 "//lib:junit",
165 "//lib/easymock",
166 "//lib/guice",
167 "//lib/jgit/org.eclipse.jgit:jgit",
168 "//lib/jgit/org.eclipse.jgit.junit:junit",
169 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +0200170)
Han-Wen Nienhuysc65ad972016-09-21 12:07:22 +0200171
172license_test(
David Ostrovskyfa189072016-11-30 08:52:06 +0100173 name = "pgm_license_test",
174 target = ":pgm",
Yuxuan 'fishy' Wang9d0e8ea2016-08-09 13:55:47 -0700175)