iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
Ivo List | be0f07e | 2020-10-07 12:14:13 -0700 | [diff] [blame] | 2 | |
Klaus Aehlig | d013721 | 2019-11-15 00:45:13 -0800 | [diff] [blame] | 3 | exports_files(glob(["**/*.jar"])) |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 4 | |
| 5 | licenses(["notice"]) # Apache 2.0 |
| 6 | |
iirina | f5a6ee1 | 2019-07-23 02:02:24 -0700 | [diff] [blame] | 7 | load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library") |
Yannic Bonenberger | 38fb90c | 2019-08-23 02:34:28 -0700 | [diff] [blame] | 8 | load("@rules_proto//proto:defs.bzl", "proto_library") |
iirina | e826049 | 2019-07-03 05:16:09 -0700 | [diff] [blame] | 9 | |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 10 | SUPRESSED_WARNINGS = select({ |
| 11 | ":windows": [], |
| 12 | "//conditions:default": [ |
| 13 | "-Wno-error", |
| 14 | "-Wno-old-style-cast", |
| 15 | ], |
| 16 | }) |
| 17 | |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 18 | filegroup( |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 19 | name = "GenClass", |
| 20 | srcs = ["java_tools/GenClass_deploy.jar"], |
| 21 | ) |
| 22 | |
iirina | 3dc59e4 | 2019-05-31 06:44:21 -0700 | [diff] [blame] | 23 | filegroup( |
| 24 | name = "jacoco_coverage_runner_filegroup", |
| 25 | srcs = ["java_tools/JacocoCoverage_jarjar_deploy.jar"], |
| 26 | ) |
| 27 | |
iirina | d654510 | 2019-05-21 06:53:59 -0700 | [diff] [blame] | 28 | java_import( |
| 29 | name = "jacoco_coverage_runner", |
| 30 | jars = ["java_tools/JacocoCoverage_jarjar_deploy.jar"], |
| 31 | ) |
| 32 | |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 33 | filegroup( |
| 34 | name = "JacocoCoverage", |
| 35 | srcs = ["java_tools/JacocoCoverage_jarjar_deploy.jar"], |
| 36 | ) |
| 37 | |
| 38 | filegroup( |
| 39 | name = "JavaBuilder", |
| 40 | srcs = ["java_tools/JavaBuilder_deploy.jar"], |
| 41 | ) |
| 42 | |
| 43 | filegroup( |
| 44 | name = "Runner", |
| 45 | srcs = ["java_tools/Runner_deploy.jar"], |
| 46 | ) |
| 47 | |
| 48 | filegroup( |
| 49 | name = "VanillaJavaBuilder", |
| 50 | srcs = ["java_tools/VanillaJavaBuilder_deploy.jar"], |
| 51 | ) |
| 52 | |
| 53 | filegroup( |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 54 | name = "Turbine", |
| 55 | srcs = ["java_tools/turbine_deploy.jar"], |
| 56 | ) |
| 57 | |
| 58 | filegroup( |
| 59 | name = "TurbineDirect", |
| 60 | srcs = ["java_tools/turbine_direct_binary_deploy.jar"], |
| 61 | ) |
| 62 | |
| 63 | filegroup( |
| 64 | name = "javac_jar", |
| 65 | srcs = ["java_tools/javac-9+181-r4173-1.jar"], |
| 66 | ) |
| 67 | |
| 68 | filegroup( |
| 69 | name = "jdk_compiler_jar", |
| 70 | srcs = ["java_tools/jdk_compiler.jar"], |
| 71 | ) |
| 72 | |
| 73 | filegroup( |
| 74 | name = "java_compiler_jar", |
| 75 | srcs = ["java_tools/java_compiler.jar"], |
| 76 | ) |
| 77 | |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 78 | java_import( |
| 79 | name = "jacoco-agent", |
Ivo List | df6d30b | 2021-09-24 07:16:15 -0700 | [diff] [blame] | 80 | jars = ["java_tools/third_party/java/jacoco/org.jacoco.agent-0.8.7.jar"], |
| 81 | srcjar = "java_tools/third_party/java/jacoco/org.jacoco.agent-0.8.7-sources.jar", |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 82 | ) |
| 83 | |
| 84 | java_import( |
| 85 | name = "jacoco-core", |
Ivo List | df6d30b | 2021-09-24 07:16:15 -0700 | [diff] [blame] | 86 | jars = ["java_tools/third_party/java/jacoco/org.jacoco.core-0.8.7.jar"], |
| 87 | srcjar = "java_tools/third_party/java/jacoco/org.jacoco.core-0.8.7-sources.jar", |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 88 | exports = [ |
| 89 | ":asm", |
| 90 | ":asm-commons", |
| 91 | ":asm-tree", |
| 92 | ], |
| 93 | ) |
| 94 | |
| 95 | filegroup( |
| 96 | name = "jacoco-core-jars", |
Ivo List | df6d30b | 2021-09-24 07:16:15 -0700 | [diff] [blame] | 97 | srcs = ["java_tools/third_party/java/jacoco/org.jacoco.core-0.8.7.jar"], |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 98 | ) |
| 99 | |
| 100 | java_import( |
| 101 | name = "jacoco-report", |
Ivo List | df6d30b | 2021-09-24 07:16:15 -0700 | [diff] [blame] | 102 | jars = ["java_tools/third_party/java/jacoco/org.jacoco.report-0.8.7.jar"], |
iirina | c9522f9 | 2019-05-28 02:18:58 -0700 | [diff] [blame] | 103 | srcjar = "java_tools/third_party/java/jacoco/org.jacoco.report-sources.jar", |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 104 | exports = [ |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 105 | ":asm", |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 106 | ":jacoco-core", |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 107 | ], |
| 108 | ) |
| 109 | |
| 110 | java_import( |
| 111 | name = "bazel-jacoco-agent", |
Ivo List | df6d30b | 2021-09-24 07:16:15 -0700 | [diff] [blame] | 112 | jars = ["java_tools/third_party/java/jacoco/jacocoagent-0.8.7.jar"], |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 113 | ) |
| 114 | |
| 115 | java_import( |
| 116 | name = "bazel-jacoco-agent-neverlink", |
Ivo List | df6d30b | 2021-09-24 07:16:15 -0700 | [diff] [blame] | 117 | jars = ["java_tools/third_party/java/jacoco/jacocoagent-0.8.7.jar"], |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 118 | neverlink = 1, |
| 119 | ) |
| 120 | |
| 121 | java_import( |
| 122 | name = "asm", |
Ivo List | cb7c1a2 | 2021-04-12 07:20:45 -0700 | [diff] [blame] | 123 | jars = ["java_tools/third_party/java/jacoco/asm-9.1.jar"], |
| 124 | srcjar = "java_tools/third_party/java/jacoco/asm-9.1-sources.jar", |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 125 | ) |
| 126 | |
| 127 | java_import( |
| 128 | name = "asm-commons", |
Ivo List | cb7c1a2 | 2021-04-12 07:20:45 -0700 | [diff] [blame] | 129 | jars = ["java_tools/third_party/java/jacoco/asm-commons-9.1.jar"], |
| 130 | srcjar = "java_tools/third_party/java/jacoco/asm-commons-9.1-sources.jar", |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 131 | runtime_deps = [":asm-tree"], |
| 132 | ) |
| 133 | |
| 134 | java_import( |
| 135 | name = "asm-tree", |
Ivo List | cb7c1a2 | 2021-04-12 07:20:45 -0700 | [diff] [blame] | 136 | jars = ["java_tools/third_party/java/jacoco/asm-tree-9.1.jar"], |
| 137 | srcjar = "java_tools/third_party/java/jacoco/asm-tree-9.1-sources.jar", |
iirina | 4e00199 | 2019-04-26 04:55:47 -0700 | [diff] [blame] | 138 | runtime_deps = [":asm"], |
| 139 | ) |
| 140 | |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 141 | config_setting( |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 142 | name = "windows", |
Ivo List | e68b1e3 | 2020-11-12 08:28:55 -0800 | [diff] [blame] | 143 | constraint_values = ["@platforms//os:windows"], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 144 | ) |
| 145 | |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 146 | config_setting( |
| 147 | name = "freebsd", |
Ivo List | e68b1e3 | 2020-11-12 08:28:55 -0800 | [diff] [blame] | 148 | constraint_values = ["@platforms//os:freebsd"], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 149 | visibility = ["//visibility:public"], |
| 150 | ) |
| 151 | |
Googler | 5e53b15 | 2020-07-06 17:38:14 -0700 | [diff] [blame] | 152 | config_setting( |
| 153 | name = "openbsd", |
Ivo List | e68b1e3 | 2020-11-12 08:28:55 -0800 | [diff] [blame] | 154 | constraint_values = ["@platforms//os:openbsd"], |
Googler | 5e53b15 | 2020-07-06 17:38:14 -0700 | [diff] [blame] | 155 | visibility = ["//visibility:public"], |
| 156 | ) |
| 157 | |
Yun Peng | 2bdd328 | 2019-07-23 05:46:01 -0700 | [diff] [blame] | 158 | cc_library( |
| 159 | name = "malloc", |
| 160 | ) |
| 161 | |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 162 | cc_binary( |
| 163 | name = "ijar_cc_binary", |
| 164 | srcs = [ |
| 165 | "java_tools/ijar/classfile.cc", |
| 166 | "java_tools/ijar/ijar.cc", |
| 167 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 168 | copts = SUPRESSED_WARNINGS, |
Yun Peng | 2bdd328 | 2019-07-23 05:46:01 -0700 | [diff] [blame] | 169 | # Remove dependency on @bazel_tools//tools/cpp:malloc, which avoid /Iexternal/tools being used |
| 170 | # in compiling actions. |
| 171 | malloc = ":malloc", |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 172 | deps = [":zip"], |
| 173 | ) |
| 174 | |
| 175 | cc_library( |
| 176 | name = "zip", |
| 177 | srcs = [ |
| 178 | "java_tools/ijar/zip.cc", |
| 179 | ] + select({ |
| 180 | ":windows": [ |
| 181 | "java_tools/ijar/mapped_file_windows.cc", |
| 182 | ], |
| 183 | "//conditions:default": [ |
| 184 | "java_tools/ijar/mapped_file_unix.cc", |
| 185 | ], |
| 186 | }), |
| 187 | hdrs = [ |
| 188 | "java_tools/ijar/common.h", |
| 189 | "java_tools/ijar/mapped_file.h", |
| 190 | "java_tools/ijar/zip.h", |
| 191 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 192 | copts = SUPRESSED_WARNINGS, |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 193 | include_prefix = "third_party", |
| 194 | strip_include_prefix = "java_tools", |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 195 | deps = [ |
| 196 | ":platform_utils", |
| 197 | ":zlib_client", |
| 198 | ] + select({ |
| 199 | ":windows": [ |
| 200 | ":errors", |
| 201 | ":filesystem", |
| 202 | ":logging", |
| 203 | ":strings", |
| 204 | ], |
| 205 | "//conditions:default": [ |
| 206 | ], |
| 207 | }), |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 208 | ) |
| 209 | |
| 210 | cc_library( |
| 211 | name = "platform_utils", |
| 212 | srcs = ["java_tools/ijar/platform_utils.cc"], |
| 213 | hdrs = [ |
| 214 | "java_tools/ijar/common.h", |
| 215 | "java_tools/ijar/platform_utils.h", |
| 216 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 217 | copts = SUPRESSED_WARNINGS, |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 218 | include_prefix = "third_party", |
| 219 | strip_include_prefix = "java_tools", |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 220 | visibility = ["//visibility:private"], |
| 221 | deps = [ |
| 222 | ":errors", |
| 223 | ":filesystem", |
| 224 | ":logging", |
| 225 | ], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 226 | ) |
| 227 | |
| 228 | cc_library( |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 229 | name = "cpp_util", |
| 230 | hdrs = [ |
| 231 | "java_tools/src/main/cpp/util/errors.h", |
| 232 | "java_tools/src/main/cpp/util/file.h", |
| 233 | "java_tools/src/main/cpp/util/file_platform.h", |
| 234 | "java_tools/src/main/cpp/util/md5.h", |
| 235 | "java_tools/src/main/cpp/util/numbers.h", |
| 236 | "java_tools/src/main/cpp/util/path.h", |
| 237 | "java_tools/src/main/cpp/util/path_platform.h", |
| 238 | "java_tools/src/main/cpp/util/port.h", |
| 239 | ], |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 240 | strip_include_prefix = "java_tools", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 241 | visibility = ["//visibility:public"], |
| 242 | deps = [ |
| 243 | ":blaze_exit_code", |
| 244 | ":errors", |
| 245 | ":filesystem", |
| 246 | ":md5", |
| 247 | ":numbers", |
| 248 | ":port", |
| 249 | ":strings", |
| 250 | ], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 251 | ) |
| 252 | |
| 253 | cc_library( |
| 254 | name = "md5", |
| 255 | srcs = ["java_tools/src/main/cpp/util/md5.cc"], |
| 256 | hdrs = ["java_tools/src/main/cpp/util/md5.h"], |
| 257 | strip_include_prefix = "java_tools", |
| 258 | ) |
| 259 | |
| 260 | cc_library( |
| 261 | name = "numbers", |
| 262 | srcs = ["java_tools/src/main/cpp/util/numbers.cc"], |
| 263 | hdrs = ["java_tools/src/main/cpp/util/numbers.h"], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 264 | strip_include_prefix = "java_tools", |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 265 | deps = [":strings"], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 266 | ) |
| 267 | |
| 268 | cc_library( |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 269 | name = "filesystem", |
| 270 | srcs = [ |
| 271 | "java_tools/src/main/cpp/util/file.cc", |
| 272 | "java_tools/src/main/cpp/util/path.cc", |
| 273 | ] + select({ |
| 274 | ":windows": [ |
| 275 | "java_tools/src/main/cpp/util/file_windows.cc", |
| 276 | "java_tools/src/main/cpp/util/path_windows.cc", |
| 277 | ], |
| 278 | "//conditions:default": [ |
| 279 | "java_tools/src/main/cpp/util/file_posix.cc", |
| 280 | "java_tools/src/main/cpp/util/path_posix.cc", |
| 281 | ], |
| 282 | }), |
| 283 | hdrs = [ |
| 284 | "java_tools/src/main/cpp/util/file.h", |
| 285 | "java_tools/src/main/cpp/util/file_platform.h", |
| 286 | "java_tools/src/main/cpp/util/path.h", |
| 287 | "java_tools/src/main/cpp/util/path_platform.h", |
| 288 | ], |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 289 | strip_include_prefix = "java_tools", |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 290 | deps = [ |
| 291 | ":blaze_exit_code", |
| 292 | ":errors", |
| 293 | ":logging", |
| 294 | ":strings", |
| 295 | ] + select({ |
| 296 | ":windows": [":lib-file"], |
| 297 | "//conditions:default": [], |
| 298 | }), |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 299 | ) |
| 300 | |
| 301 | cc_library( |
| 302 | name = "lib-file", |
iirina | f5a6ee1 | 2019-07-23 02:02:24 -0700 | [diff] [blame] | 303 | srcs = [ |
| 304 | "java_tools/src/main/native/windows/file.cc", |
| 305 | "java_tools/src/main/native/windows/util.cc", |
| 306 | ], |
| 307 | hdrs = [ |
| 308 | "java_tools/src/main/native/windows/file.h", |
| 309 | "java_tools/src/main/native/windows/util.h", |
| 310 | ], |
Kevin Hogeland | 2f0927a | 2021-05-21 01:14:24 -0700 | [diff] [blame] | 311 | linkopts = [ |
| 312 | "-DEFAULTLIB:advapi32.lib", |
| 313 | ], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 314 | strip_include_prefix = "java_tools", |
| 315 | ) |
| 316 | |
| 317 | cc_library( |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 318 | name = "errors", |
| 319 | srcs = select({ |
| 320 | ":windows": ["java_tools/src/main/cpp/util/errors_windows.cc"], |
| 321 | "//conditions:default": ["java_tools/src/main/cpp/util/errors_posix.cc"], |
| 322 | }), |
| 323 | hdrs = ["java_tools/src/main/cpp/util/errors.h"], |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 324 | strip_include_prefix = "java_tools", |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 325 | deps = [ |
| 326 | ":logging", |
| 327 | ":port", |
| 328 | ":strings", |
| 329 | ], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 330 | ) |
| 331 | |
| 332 | cc_library( |
| 333 | name = "strings", |
| 334 | srcs = ["java_tools/src/main/cpp/util/strings.cc"], |
| 335 | hdrs = ["java_tools/src/main/cpp/util/strings.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 336 | copts = SUPRESSED_WARNINGS, |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 337 | # Automatically propagate the symbol definition to rules depending on this. |
| 338 | defines = [ |
| 339 | "BLAZE_OPENSOURCE", |
| 340 | ], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 341 | strip_include_prefix = "java_tools", |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 342 | deps = [":blaze_exit_code"], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 343 | ) |
| 344 | |
| 345 | cc_library( |
| 346 | name = "blaze_exit_code", |
| 347 | hdrs = ["java_tools/src/main/cpp/util/exit_code.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 348 | copts = SUPRESSED_WARNINGS, |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 349 | strip_include_prefix = "java_tools", |
| 350 | ) |
| 351 | |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 352 | cc_library( |
| 353 | name = "port", |
| 354 | srcs = ["java_tools/src/main/cpp/util/port.cc"], |
| 355 | hdrs = ["java_tools/src/main/cpp/util/port.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 356 | copts = SUPRESSED_WARNINGS, |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 357 | strip_include_prefix = "java_tools", |
| 358 | ) |
| 359 | |
| 360 | cc_library( |
| 361 | name = "logging", |
| 362 | srcs = ["java_tools/src/main/cpp/util/logging.cc"], |
| 363 | hdrs = ["java_tools/src/main/cpp/util/logging.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 364 | copts = SUPRESSED_WARNINGS, |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 365 | strip_include_prefix = "java_tools", |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 366 | deps = [ |
| 367 | ":blaze_exit_code", |
| 368 | ":strings", |
| 369 | ], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 370 | ) |
| 371 | |
| 372 | cc_library( |
| 373 | name = "zlib_client", |
| 374 | srcs = ["java_tools/ijar/zlib_client.cc"], |
| 375 | hdrs = [ |
| 376 | "java_tools/ijar/common.h", |
| 377 | "java_tools/ijar/zlib_client.h", |
| 378 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 379 | copts = SUPRESSED_WARNINGS, |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 380 | include_prefix = "third_party", |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 381 | strip_include_prefix = "java_tools", |
| 382 | deps = ["//java_tools/zlib"], |
iirina | d4651e8 | 2019-03-15 03:15:37 -0700 | [diff] [blame] | 383 | ) |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 384 | |
| 385 | ##################### singlejar |
| 386 | |
| 387 | cc_binary( |
iirina | ebdbdcd | 2019-04-09 04:43:08 -0700 | [diff] [blame] | 388 | name = "singlejar_cc_bin", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 389 | srcs = [ |
| 390 | "java_tools/src/tools/singlejar/singlejar_main.cc", |
| 391 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 392 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 393 | linkopts = select({ |
| 394 | ":freebsd": ["-lm"], |
Googler | 5e53b15 | 2020-07-06 17:38:14 -0700 | [diff] [blame] | 395 | ":openbsd": ["-lm"], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 396 | "//conditions:default": [], |
| 397 | }), |
| 398 | linkstatic = 1, |
Yun Peng | 2bdd328 | 2019-07-23 05:46:01 -0700 | [diff] [blame] | 399 | # Remove dependency on @bazel_tools//tools/cpp:malloc, which avoid /Iexternal/tools being used |
| 400 | # in compiling actions. |
| 401 | malloc = ":malloc", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 402 | visibility = ["//visibility:public"], |
| 403 | deps = [ |
| 404 | ":options", |
| 405 | ":output_jar", |
| 406 | "//java_tools/zlib", |
| 407 | ], |
| 408 | ) |
| 409 | |
| 410 | cc_binary( |
| 411 | name = "singlejar_local", |
| 412 | srcs = [ |
| 413 | "java_tools/src/tools/singlejar/singlejar_local_main.cc", |
| 414 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 415 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 416 | linkopts = select({ |
| 417 | ":freebsd": ["-lm"], |
Googler | 5e53b15 | 2020-07-06 17:38:14 -0700 | [diff] [blame] | 418 | ":openbsd": ["-lm"], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 419 | "//conditions:default": [], |
| 420 | }), |
| 421 | linkstatic = 1, |
| 422 | visibility = ["//visibility:public"], |
| 423 | deps = [ |
| 424 | ":combiners", |
| 425 | ":desugar_checking", |
| 426 | ":options", |
| 427 | ":output_jar", |
| 428 | "//java_tools/zlib", |
| 429 | ], |
| 430 | ) |
| 431 | |
| 432 | cc_library( |
| 433 | name = "combiners", |
| 434 | srcs = [ |
| 435 | "java_tools/src/tools/singlejar/combiners.cc", |
iirina | ebdbdcd | 2019-04-09 04:43:08 -0700 | [diff] [blame] | 436 | ], |
| 437 | hdrs = [ |
| 438 | "java_tools/src/tools/singlejar/combiners.h", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 439 | ":transient_bytes", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 440 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 441 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 442 | strip_include_prefix = "java_tools", |
| 443 | deps = [ |
| 444 | "//java_tools/zlib", |
| 445 | ], |
| 446 | ) |
| 447 | |
| 448 | proto_library( |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 449 | name = "desugar_deps_proto", |
| 450 | srcs = ["java_tools/src/main/protobuf/desugar_deps.proto"], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 451 | ) |
| 452 | |
| 453 | cc_proto_library( |
| 454 | name = "desugar_deps_cc_proto", |
| 455 | deps = [":desugar_deps_proto"], |
| 456 | ) |
| 457 | |
| 458 | cc_library( |
| 459 | name = "desugar_checking", |
| 460 | srcs = ["java_tools/src/tools/singlejar/desugar_checking.cc"], |
| 461 | hdrs = ["java_tools/src/tools/singlejar/desugar_checking.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 462 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 463 | strip_include_prefix = "java_tools", |
| 464 | deps = [ |
| 465 | ":combiners", |
| 466 | ":desugar_deps_cc_proto", |
| 467 | ], |
| 468 | ) |
| 469 | |
| 470 | cc_library( |
| 471 | name = "diag", |
| 472 | hdrs = ["java_tools/src/tools/singlejar/diag.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 473 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 474 | strip_include_prefix = "java_tools", |
| 475 | visibility = ["//visibility:private"], |
| 476 | ) |
| 477 | |
| 478 | cc_library( |
| 479 | name = "singlejar_port", |
| 480 | hdrs = ["java_tools/src/tools/singlejar/port.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 481 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 482 | strip_include_prefix = "java_tools", |
| 483 | visibility = ["//visibility:private"], |
| 484 | ) |
| 485 | |
| 486 | cc_library( |
| 487 | name = "mapped_file", |
iirina | ebdbdcd | 2019-04-09 04:43:08 -0700 | [diff] [blame] | 488 | srcs = ["java_tools/src/tools/singlejar/mapped_file.cc"], |
| 489 | hdrs = ["java_tools/src/tools/singlejar/mapped_file.h"] + |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 490 | select({ |
| 491 | ":windows": ["java_tools/src/tools/singlejar/mapped_file_windows.inc"], |
| 492 | "//conditions:default": ["java_tools/src/tools/singlejar/mapped_file_posix.inc"], |
| 493 | }), |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 494 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 495 | strip_include_prefix = "java_tools", |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 496 | visibility = ["//visibility:private"], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 497 | deps = [ |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 498 | ":cpp_util", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 499 | ":diag", |
| 500 | ":singlejar_port", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 501 | ], |
| 502 | ) |
| 503 | |
| 504 | cc_library( |
| 505 | name = "input_jar", |
| 506 | srcs = [ |
| 507 | "java_tools/src/tools/singlejar/input_jar.cc", |
| 508 | ], |
| 509 | hdrs = [ |
| 510 | "java_tools/src/tools/singlejar/input_jar.h", |
| 511 | "java_tools/src/tools/singlejar/zip_headers.h", |
| 512 | ], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 513 | copts = SUPRESSED_WARNINGS, |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 514 | strip_include_prefix = "java_tools", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 515 | deps = [ |
| 516 | ":diag", |
| 517 | ":mapped_file", |
| 518 | ], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 519 | ) |
| 520 | |
| 521 | cc_library( |
| 522 | name = "options", |
| 523 | srcs = [ |
| 524 | "java_tools/src/tools/singlejar/options.cc", |
| 525 | "java_tools/src/tools/singlejar/options.h", |
| 526 | ], |
| 527 | hdrs = ["java_tools/src/tools/singlejar/options.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 528 | copts = SUPRESSED_WARNINGS, |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 529 | strip_include_prefix = "java_tools", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 530 | deps = [ |
| 531 | ":diag", |
| 532 | ":token_stream", |
| 533 | ], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 534 | ) |
| 535 | |
| 536 | cc_library( |
| 537 | name = "output_jar", |
| 538 | srcs = [ |
| 539 | "java_tools/src/tools/singlejar/output_jar.cc", |
| 540 | "java_tools/src/tools/singlejar/output_jar.h", |
| 541 | ":zip_headers", |
| 542 | ], |
| 543 | hdrs = ["java_tools/src/tools/singlejar/output_jar.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 544 | copts = SUPRESSED_WARNINGS, |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 545 | strip_include_prefix = "java_tools", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 546 | deps = [ |
| 547 | ":combiners", |
iirina | b031749 | 2019-04-29 09:26:43 -0700 | [diff] [blame] | 548 | ":cpp_util", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 549 | ":diag", |
| 550 | ":input_jar", |
| 551 | ":mapped_file", |
| 552 | ":options", |
| 553 | ":singlejar_port", |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 554 | "//java_tools/zlib", |
| 555 | ], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 556 | ) |
| 557 | |
| 558 | cc_library( |
| 559 | name = "token_stream", |
| 560 | hdrs = ["java_tools/src/tools/singlejar/token_stream.h"], |
Stephan Wolski | f1bbe58 | 2019-08-27 00:58:23 -0700 | [diff] [blame] | 561 | copts = SUPRESSED_WARNINGS, |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 562 | strip_include_prefix = "java_tools", |
iirina | f5a6ee1 | 2019-07-23 02:02:24 -0700 | [diff] [blame] | 563 | deps = [ |
| 564 | ":diag", |
| 565 | ":filesystem", |
| 566 | ], |
iirina | e4ac616 | 2019-04-08 01:37:20 -0700 | [diff] [blame] | 567 | ) |
| 568 | |
| 569 | filegroup( |
| 570 | name = "transient_bytes", |
| 571 | srcs = [ |
| 572 | "java_tools/src/tools/singlejar/diag.h", |
| 573 | "java_tools/src/tools/singlejar/transient_bytes.h", |
| 574 | "java_tools/src/tools/singlejar/zlib_interface.h", |
| 575 | ":zip_headers", |
| 576 | ], |
| 577 | ) |
| 578 | |
| 579 | filegroup( |
| 580 | name = "zip_headers", |
| 581 | srcs = ["java_tools/src/tools/singlejar/zip_headers.h"], |
| 582 | ) |
iirina | f50b8a4 | 2019-05-13 07:00:26 -0700 | [diff] [blame] | 583 | |
iirina | f50b8a4 | 2019-05-13 07:00:26 -0700 | [diff] [blame] | 584 | ################### Proguard ################### |
| 585 | java_import( |
| 586 | name = "proguard_import", |
| 587 | jars = ["java_tools/third_party/java/proguard/proguard.jar"], |
| 588 | ) |
| 589 | |
| 590 | java_binary( |
| 591 | name = "proguard", |
| 592 | main_class = "proguard.ProGuard", |
iirina | f50b8a4 | 2019-05-13 07:00:26 -0700 | [diff] [blame] | 593 | visibility = ["//visibility:public"], |
iirina | f5a6ee1 | 2019-07-23 02:02:24 -0700 | [diff] [blame] | 594 | runtime_deps = [":proguard_import"], |
iirina | f50b8a4 | 2019-05-13 07:00:26 -0700 | [diff] [blame] | 595 | ) |