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