David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 1 | load("//tools/bzl:java.bzl", "java_library2") |
| 2 | load("//tools/bzl:junit.bzl", "junit_tests") |
| 3 | load("//tools/bzl:license.bzl", "license_test") |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 4 | |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 5 | SRCS = "src/main/java/com/google/gerrit/pgm/" |
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 | RSRCS = "src/main/resources/com/google/gerrit/pgm/" |
| 8 | |
| 9 | INIT_API_SRCS = glob([SRCS + "init/api/*.java"]) |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 10 | |
| 11 | BASE_JETTY_DEPS = [ |
Dave Borowitz | a9c6832 | 2017-06-27 09:18:21 -0400 | [diff] [blame] | 12 | "//gerrit-common:annotations", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 13 | "//gerrit-common:server", |
| 14 | "//gerrit-extension-api:api", |
| 15 | "//gerrit-gwtexpui:linker_server", |
| 16 | "//gerrit-gwtexpui:server", |
| 17 | "//gerrit-httpd:httpd", |
| 18 | "//gerrit-server:server", |
| 19 | "//gerrit-sshd:sshd", |
| 20 | "//lib:guava", |
| 21 | "//lib/guice:guice", |
| 22 | "//lib/guice:guice-assistedinject", |
| 23 | "//lib/guice:guice-servlet", |
| 24 | "//lib/jgit/org.eclipse.jgit:jgit", |
| 25 | "//lib/joda:joda-time", |
| 26 | "//lib/log:api", |
| 27 | "//lib/log:log4j", |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 28 | ] |
| 29 | |
| 30 | DEPS = BASE_JETTY_DEPS + [ |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 31 | "//gerrit-reviewdb:server", |
Dave Borowitz | cab1222 | 2017-08-09 12:55:51 -0400 | [diff] [blame] | 32 | "//gerrit-server:metrics", |
Dave Borowitz | 798b883 | 2017-08-03 11:07:15 -0400 | [diff] [blame] | 33 | "//gerrit-server:module", |
| 34 | "//gerrit-server:receive", |
Edwin Kempin | 5be9c31 | 2017-07-07 10:40:55 +0200 | [diff] [blame] | 35 | "//lib:gwtorm", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 36 | "//lib/log:jsonevent-layout", |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 37 | ] |
| 38 | |
| 39 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 40 | name = "init-api", |
| 41 | srcs = INIT_API_SRCS, |
| 42 | visibility = ["//visibility:public"], |
Dave Borowitz | a9c6832 | 2017-06-27 09:18:21 -0400 | [diff] [blame] | 43 | deps = DEPS, |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 44 | ) |
| 45 | |
| 46 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 47 | name = "init", |
Edwin Kempin | a4c095f | 2017-01-05 09:36:37 +0100 | [diff] [blame] | 48 | srcs = glob([SRCS + "init/**/*.java"]), |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 49 | resources = glob([RSRCS + "init/*"]), |
| 50 | visibility = ["//visibility:public"], |
| 51 | deps = DEPS + [ |
| 52 | ":init-api", |
| 53 | ":util", |
Dave Borowitz | e47be68 | 2017-08-08 09:53:39 -0400 | [diff] [blame] | 54 | "//gerrit-index:index", |
David Pursehouse | 9561f38 | 2017-02-28 17:32:44 +0900 | [diff] [blame] | 55 | "//gerrit-elasticsearch:elasticsearch", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 56 | "//gerrit-launcher:launcher", # We want this dep to be provided_deps |
| 57 | "//gerrit-lucene:lucene", |
| 58 | "//lib:args4j", |
| 59 | "//lib:derby", |
| 60 | "//lib:gwtjsonrpc", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 61 | "//lib:h2", |
| 62 | "//lib/commons:validator", |
| 63 | "//lib/mina:sshd", |
| 64 | ], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 65 | ) |
| 66 | |
| 67 | REST_UTIL_DEPS = [ |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 68 | "//gerrit-cache-h2:cache-h2", |
Dave Borowitz | a3cc510 | 2018-05-08 21:24:24 +0200 | [diff] [blame] | 69 | "//gerrit-cache-mem:mem", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 70 | "//gerrit-util-cli:cli", |
| 71 | "//lib:args4j", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 72 | "//lib/commons:dbcp", |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 73 | ] |
| 74 | |
| 75 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 76 | name = "util", |
| 77 | visibility = ["//visibility:public"], |
| 78 | exports = [":util-nodep"], |
| 79 | runtime_deps = DEPS + REST_UTIL_DEPS, |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 80 | ) |
| 81 | |
| 82 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 83 | name = "util-nodep", |
| 84 | srcs = glob([SRCS + "util/*.java"]), |
| 85 | visibility = ["//visibility:public"], |
| 86 | deps = DEPS + REST_UTIL_DEPS, # We want all these deps to be provided_deps |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 87 | ) |
| 88 | |
| 89 | JETTY_DEPS = [ |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 90 | "//lib/jetty:jmx", |
| 91 | "//lib/jetty:server", |
| 92 | "//lib/jetty:servlet", |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 93 | ] |
| 94 | |
| 95 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 96 | name = "http", |
| 97 | visibility = ["//visibility:public"], |
| 98 | exports = [":http-jetty"], |
| 99 | runtime_deps = DEPS + JETTY_DEPS, |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 100 | ) |
| 101 | |
| 102 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 103 | name = "http-jetty", |
| 104 | srcs = glob([SRCS + "http/jetty/*.java"]), |
| 105 | visibility = ["//visibility:public"], |
| 106 | deps = JETTY_DEPS + BASE_JETTY_DEPS + [ |
| 107 | # We want all these deps to be provided_deps |
| 108 | "//gerrit-launcher:launcher", |
| 109 | "//gerrit-reviewdb:client", |
| 110 | "//lib:servlet-api-3_1", |
| 111 | ], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 112 | ) |
| 113 | |
| 114 | REST_PGM_DEPS = [ |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 115 | ":http", |
| 116 | ":init", |
| 117 | ":init-api", |
| 118 | ":util", |
| 119 | "//gerrit-cache-h2:cache-h2", |
Dave Borowitz | a3cc510 | 2018-05-08 21:24:24 +0200 | [diff] [blame] | 120 | "//gerrit-cache-mem:mem", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 121 | "//gerrit-elasticsearch:elasticsearch", |
| 122 | "//gerrit-gpg:gpg", |
Dave Borowitz | e47be68 | 2017-08-08 09:53:39 -0400 | [diff] [blame] | 123 | "//gerrit-index:index", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 124 | "//gerrit-lucene:lucene", |
| 125 | "//gerrit-oauth:oauth", |
| 126 | "//gerrit-openid:openid", |
| 127 | "//lib:args4j", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 128 | "//lib:protobuf", |
| 129 | "//lib:servlet-api-3_1-without-neverlink", |
| 130 | "//lib/prolog:cafeteria", |
| 131 | "//lib/prolog:compiler", |
| 132 | "//lib/prolog:runtime", |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 133 | ] |
| 134 | |
| 135 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 136 | name = "pgm", |
| 137 | resources = glob([RSRCS + "*"]), |
| 138 | visibility = ["//visibility:public"], |
| 139 | runtime_deps = DEPS + REST_PGM_DEPS + [ |
| 140 | ":daemon", |
| 141 | ], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 142 | ) |
| 143 | |
| 144 | # no transitive deps, used for gerrit-acceptance-framework |
| 145 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 146 | name = "daemon", |
| 147 | srcs = glob([ |
| 148 | SRCS + "*.java", |
| 149 | SRCS + "rules/*.java", |
| 150 | ]), |
| 151 | resources = glob([RSRCS + "*"]), |
| 152 | visibility = ["//visibility:public"], |
| 153 | deps = DEPS + REST_PGM_DEPS + [ |
| 154 | # We want all these deps to be provided_deps |
| 155 | "//gerrit-launcher:launcher", |
| 156 | "//lib/auto:auto-value", |
David Ostrovsky | 5531347 | 2018-08-01 22:33:57 +0200 | [diff] [blame] | 157 | "//lib/auto:auto-value-annotations", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 158 | ], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 159 | ) |
| 160 | |
| 161 | junit_tests( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 162 | name = "pgm_tests", |
| 163 | srcs = glob(["src/test/java/**/*.java"]), |
| 164 | deps = [ |
Shawn Pearce | d79dcef | 2017-06-10 11:57:30 -0700 | [diff] [blame] | 165 | ":http-jetty", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 166 | ":init", |
| 167 | ":init-api", |
| 168 | ":pgm", |
| 169 | "//gerrit-common:server", |
| 170 | "//gerrit-server:server", |
| 171 | "//lib:guava", |
| 172 | "//lib:junit", |
Shawn Pearce | d79dcef | 2017-06-10 11:57:30 -0700 | [diff] [blame] | 173 | "//lib:truth", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 174 | "//lib/easymock", |
| 175 | "//lib/guice", |
| 176 | "//lib/jgit/org.eclipse.jgit:jgit", |
| 177 | "//lib/jgit/org.eclipse.jgit.junit:junit", |
| 178 | ], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 179 | ) |
Han-Wen Nienhuys | c65ad97 | 2016-09-21 12:07:22 +0200 | [diff] [blame] | 180 | |
| 181 | license_test( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 182 | name = "pgm_license_test", |
| 183 | target = ":pgm", |
Yuxuan 'fishy' Wang | 9d0e8ea | 2016-08-09 13:55:47 -0700 | [diff] [blame] | 184 | ) |