| load("@rules_java//java:defs.bzl", "java_import", "java_library", "java_plugin") | |
| load("@rules_license//rules:license.bzl", "license") | |
| load("//src/tools/bzlmod:utils.bzl", "get_repo_root") | |
| load("//tools/build_defs/proguard:proguard.bzl", "proguard_jar") | |
| load("//tools/distributions:distribution_rules.bzl", "distrib_jar_filegroup", "distrib_java_import") | |
| package(default_visibility = ["//visibility:public"]) | |
| exports_files(["remoteapis/MODULE.bazel"]) | |
| filegroup( | |
| name = "srcs", | |
| srcs = glob(["**"]) + [ | |
| "//third_party/allocation_instrumenter:srcs", | |
| "//third_party/brotli/java/org/brotli/dec:srcs", | |
| "//third_party/chicory:srcs", | |
| "//third_party/def_parser:srcs", | |
| "//third_party/google/bytestream:srcs", | |
| "//third_party/google/devtools/build/v1:srcs", | |
| "//third_party/google/longrunning:srcs", | |
| "//third_party/google/protobuf:srcs", | |
| "//third_party/google/rpc:srcs", | |
| "//third_party/googleapis:srcs", | |
| "//third_party/grpc:srcs", | |
| "//third_party/grpc-java:srcs", | |
| "//third_party/ijar:srcs", | |
| "//third_party/jarjar:srcs", | |
| "//third_party/java/allocation_instrumenter:srcs", | |
| "//third_party/java/apache_commons_compress:srcs", | |
| "//third_party/java/apache_commons_lang3:srcs", | |
| "//third_party/java/asm:srcs", | |
| "//third_party/java/async_profiler:srcs", | |
| "//third_party/java/auth_kit:srcs", | |
| "//third_party/java/auto:srcs", | |
| "//third_party/java/auto_value_gson:srcs", | |
| "//third_party/java/caffeine:srcs", | |
| "//third_party/java/checker_framework_annotations:srcs", | |
| "//third_party/java/commonmark:srcs", | |
| "//third_party/java/compile_testing:srcs", | |
| "//third_party/java/error_prone:srcs", | |
| "//third_party/java/fastutil:srcs", | |
| "//third_party/java/flogger:srcs", | |
| "//third_party/java/grpc:srcs", | |
| "//third_party/java/gson:srcs", | |
| "//third_party/java/guava:srcs", | |
| "//third_party/java/jacoco:srcs", | |
| "//third_party/java/jakarta_commons_lang/v2_6:srcs", | |
| "//third_party/java/jakarta_velocity:srcs", | |
| "//third_party/java/jarjar:srcs", | |
| "//third_party/java/java_diff_utils:srcs", | |
| "//third_party/java/javapoet:srcs", | |
| "//third_party/java/jcommander:srcs", | |
| "//third_party/java/jimfs:srcs", | |
| "//third_party/java/jmh:srcs", | |
| "//third_party/java/jol:srcs", | |
| "//third_party/java/jspecify_annotations:srcs", | |
| "//third_party/java/jsr250_annotations:srcs", | |
| "//third_party/java/jsr305_annotations:srcs", | |
| "//third_party/java/jsr330_inject:srcs", | |
| "//third_party/java/junit:srcs", | |
| "//third_party/java/mockito:srcs", | |
| "//third_party/java/netty4:srcs", | |
| "//third_party/java/proguard:srcs", | |
| "//third_party/java/protobuf:srcs", | |
| "//third_party/java/protobuf/util:srcs", | |
| "//third_party/java/roaringbitmap:srcs", | |
| "//third_party/java/rxjava3:srcs", | |
| "//third_party/java/snakeyaml:srcs", | |
| "//third_party/java/testparameterinjector:srcs", | |
| "//third_party/java/truth:srcs", | |
| "//third_party/java/truth/extensions:srcs", | |
| "//third_party/java/turbine:srcs", | |
| "//third_party/java/xz:srcs", | |
| "//third_party/java/zstd_jni:srcs", | |
| "//third_party/pprof:srcs", | |
| "//third_party/protobuf:srcs", | |
| "//third_party/py/abseil:srcs", | |
| "//third_party/py/frozendict:srcs", | |
| ], | |
| ) | |
| # Filegroup to ship the sources to the Bazel embededded tools | |
| # This filegroup should contains all GPL with classpath exception | |
| # and LGPL code that we use in Bazel. | |
| filegroup( | |
| name = "gpl-srcs", | |
| srcs = [], | |
| ) | |
| filegroup( | |
| name = "patches", | |
| srcs = glob(["*.patch"]), | |
| ) | |
| alias( | |
| name = "apache_commons_collections", | |
| actual = "@maven//:commons_collections_commons_collections", | |
| ) | |
| alias( | |
| name = "apache_commons_lang", | |
| actual = "@maven//:commons_lang_commons_lang", | |
| ) | |
| alias( | |
| name = "apache_commons_compress", | |
| actual = "@maven//:org_apache_commons_commons_compress", | |
| ) | |
| alias( | |
| name = "apache_velocity", | |
| actual = "@maven//:org_apache_velocity_velocity", | |
| ) | |
| java_library( | |
| name = "api_client", | |
| exports = [ | |
| "@maven//:com_google_api_client_google_api_client", | |
| "@maven//:com_google_api_client_google_api_client_gson", | |
| "@maven//:com_google_http_client_google_http_client", | |
| "@maven//:com_google_http_client_google_http_client_gson", | |
| ], | |
| runtime_deps = [ | |
| ":gson", | |
| ], | |
| ) | |
| exports_files( | |
| [ | |
| # keep sorted | |
| "asm/asm-9.10-sources.jar", | |
| "asm/asm-analysis-9.10-sources.jar", | |
| "asm/asm-commons-9.10-sources.jar", | |
| "asm/asm-tree-9.10-sources.jar", | |
| ], | |
| ) | |
| distrib_java_import( | |
| name = "asm", | |
| enable_distributions = ["debian"], | |
| jars = ["asm/asm-9.10.jar"], | |
| srcjar = "asm/asm-9.10-sources.jar", | |
| ) | |
| java_import( | |
| name = "asm-analysis", | |
| jars = ["asm/asm-analysis-9.10.jar"], | |
| srcjar = "asm/asm-analysis-9.10-sources.jar", | |
| runtime_deps = [":asm-tree"], | |
| ) | |
| java_import( | |
| name = "asm-commons", | |
| jars = ["asm/asm-commons-9.10.jar"], | |
| srcjar = "asm/asm-commons-9.10-sources.jar", | |
| runtime_deps = [":asm-tree"], | |
| ) | |
| java_import( | |
| name = "asm-tree", | |
| jars = ["asm/asm-tree-9.10.jar"], | |
| srcjar = "asm/asm-tree-9.10-sources.jar", | |
| runtime_deps = [":asm"], | |
| ) | |
| java_import( | |
| name = "asm-util", | |
| jars = ["asm/asm-util-9.10.jar"], | |
| srcjar = "asm/asm-util-9.10-sources.jar", | |
| runtime_deps = [":asm-tree"], | |
| ) | |
| java_library( | |
| name = "auth", | |
| exports = [ | |
| "@maven//:com_google_auth_google_auth_library_credentials", | |
| "@maven//:com_google_auth_google_auth_library_oauth2_http", | |
| ], | |
| runtime_deps = [ | |
| ":api_client", | |
| ":guava", | |
| ], | |
| ) | |
| java_plugin( | |
| name = "auto_annotation_plugin", | |
| processor_class = "com.google.auto.value.processor.AutoAnnotationProcessor", | |
| deps = [ | |
| ":apache_commons_collections", | |
| ":apache_velocity", | |
| ":auto_common", | |
| ":auto_service_lib", | |
| ":auto_value_lib", | |
| ":guava", | |
| ":jsr305", | |
| ], | |
| ) | |
| alias( | |
| name = "auto_common", | |
| actual = "@maven//:com_google_auto_auto_common", | |
| ) | |
| java_library( | |
| name = "auto_service", | |
| exported_plugins = [ | |
| ":auto_service_plugin", | |
| ], | |
| exports = [ | |
| ":auto_service_api", | |
| ], | |
| ) | |
| java_plugin( | |
| name = "auto_service_plugin", | |
| processor_class = "com.google.auto.service.processor.AutoServiceProcessor", | |
| deps = [ | |
| ":auto_common", | |
| ":auto_service_lib", | |
| ":guava", | |
| ], | |
| ) | |
| java_library( | |
| name = "auto_service_api", | |
| exports = [ | |
| "@maven//:com_google_auto_service_auto_service_annotations", | |
| ], | |
| ) | |
| java_library( | |
| name = "auto_service_lib", | |
| exports = [ | |
| "@maven//:com_google_auto_service_auto_service", | |
| "@maven//:com_google_auto_service_auto_service_annotations", | |
| ], | |
| ) | |
| java_plugin( | |
| name = "auto_value_plugin", | |
| processor_class = "com.google.auto.value.processor.AutoValueProcessor", | |
| deps = [ | |
| ":apache_commons_collections", | |
| ":apache_velocity", | |
| ":auto_common", | |
| ":auto_service_lib", | |
| ":auto_value_lib", | |
| ":guava", | |
| ], | |
| ) | |
| java_plugin( | |
| name = "auto_oneof_plugin", | |
| processor_class = "com.google.auto.value.processor.AutoOneOfProcessor", | |
| deps = [ | |
| ":apache_commons_collections", | |
| ":apache_velocity", | |
| ":auto_common", | |
| ":auto_service_lib", | |
| ":auto_value_lib", | |
| ":guava", | |
| ], | |
| ) | |
| java_plugin( | |
| name = "auto_builder_plugin", | |
| processor_class = "com.google.auto.value.processor.AutoBuilderProcessor", | |
| deps = [ | |
| ":apache_commons_collections", | |
| ":apache_velocity", | |
| ":auto_common", | |
| ":auto_service_lib", | |
| ":auto_value_lib", | |
| ":guava", | |
| ], | |
| ) | |
| java_plugin( | |
| name = "auto_value_gson_plugin", | |
| processor_class = "com.ryanharter.auto.value.gson.factory.AutoValueGsonAdapterFactoryProcessor", | |
| deps = [ | |
| "@maven//:com_ryanharter_auto_value_auto_value_gson_extension", | |
| "@maven//:com_ryanharter_auto_value_auto_value_gson_factory", | |
| ], | |
| ) | |
| java_library( | |
| name = "auto_value", | |
| exported_plugins = [ | |
| ":auto_annotation_plugin", | |
| ":auto_builder_plugin", | |
| ":auto_oneof_plugin", | |
| ":auto_value_plugin", | |
| ":auto_value_gson_plugin", | |
| ], | |
| exports = [ | |
| ":auto_value_api", | |
| "@maven//:com_ryanharter_auto_value_auto_value_gson_runtime", | |
| ], | |
| ) | |
| java_library( | |
| name = "auto_value_api", | |
| exports = [ | |
| "@maven//:com_google_auto_value_auto_value_annotations", | |
| ], | |
| ) | |
| java_library( | |
| name = "auto_value_lib", | |
| exports = [ | |
| "@maven//:com_google_auto_value_auto_value", | |
| "@maven//:com_google_auto_value_auto_value_annotations", | |
| ], | |
| ) | |
| # For bootstrapping JavaBuilder | |
| distrib_jar_filegroup( | |
| name = "auto_value-jars", | |
| srcs = [ | |
| "@maven//:com_google_auto_value_auto_value_annotations_file", | |
| "@maven//:com_google_auto_value_auto_value_file", | |
| ], | |
| enable_distributions = ["debian"], | |
| ) | |
| java_import( | |
| name = "async_profiler", | |
| jars = ["@async_profiler//file"], | |
| runtime_deps = [":async_profiler_native"], | |
| ) | |
| java_library( | |
| name = "async_profiler_native", | |
| resource_strip_prefix = select({ | |
| "//src/conditions:darwin": get_repo_root("async_profiler_macos"), | |
| "//src/conditions:linux_aarch64": get_repo_root("async_profiler_linux_arm64"), | |
| "//src/conditions:linux_x86_64": get_repo_root("async_profiler_linux_x64"), | |
| "//conditions:default": None, | |
| }), | |
| resources = select({ | |
| "//src/conditions:darwin": ["@async_profiler_macos//:libasyncProfiler"], | |
| "//src/conditions:linux_aarch64": ["@async_profiler_linux_arm64//:libasyncProfiler"], | |
| "//src/conditions:linux_x86_64": ["@async_profiler_linux_x64//:libasyncProfiler"], | |
| "//conditions:default": [], | |
| }), | |
| ) | |
| alias( | |
| name = "checker_framework_annotations", | |
| actual = "@maven//:org_checkerframework_checker_qual", | |
| ) | |
| alias( | |
| name = "gson", | |
| actual = "@maven//:com_google_code_gson_gson", | |
| ) | |
| alias( | |
| name = "caffeine", | |
| actual = "@maven//:com_github_ben_manes_caffeine_caffeine", | |
| ) | |
| # When using new classes from this dependency, make sure to update fastutil.proguard. | |
| java_import( | |
| name = "fastutil", | |
| jars = [":fastutil-stripped.jar"], | |
| ) | |
| proguard_jar( | |
| name = "fastutil_proguard", | |
| srcs = [ | |
| "@maven//:it_unimi_dsi_fastutil_file", | |
| ], | |
| out = "fastutil-stripped.jar", | |
| proguard_spec = "fastutil.proguard", | |
| deps = [ | |
| "@rules_java//toolchains:platformclasspath_nostrip", | |
| ], | |
| ) | |
| java_library( | |
| name = "error_prone_annotations", | |
| exports = [ | |
| "@maven//:com_google_errorprone_error_prone_annotations", | |
| ], | |
| ) | |
| distrib_jar_filegroup( | |
| name = "error_prone_annotations-jar", | |
| srcs = [ | |
| "@maven//:com_google_errorprone_error_prone_annotations_file", | |
| "@maven//:org_threeten_threeten_extra_file", | |
| ], | |
| enable_distributions = ["debian"], | |
| ) | |
| java_library( | |
| name = "error_prone", | |
| exports = [ | |
| ":error_prone_annotations", | |
| "@maven//:com_google_errorprone_error_prone_check_api", | |
| "@maven//:com_google_errorprone_error_prone_core", | |
| ], | |
| ) | |
| alias( | |
| name = "jcip_annotations", | |
| actual = "@maven//:com_github_stephenc_jcip_jcip_annotations", | |
| ) | |
| # For bootstrapping JavaBuilder | |
| distrib_jar_filegroup( | |
| name = "jcip_annotations-jars", | |
| srcs = [ | |
| "@maven//:com_github_stephenc_jcip_jcip_annotations_file", | |
| ], | |
| enable_distributions = ["debian"], | |
| ) | |
| alias( | |
| name = "pcollections", | |
| actual = "@maven//:org_pcollections_pcollections", | |
| ) | |
| # For bootstrapping JavaBuilder | |
| filegroup( | |
| name = "bootstrap_guava_and_error_prone-jars", | |
| srcs = [ | |
| ":error_prone_annotations-jar", | |
| ":guava-jars", | |
| ":jcip_annotations-jars", | |
| ":jsr305-jars", | |
| ], | |
| ) | |
| java_library( | |
| name = "guava", | |
| applicable_licenses = [":guava_license"], | |
| exports = [ | |
| ":error_prone_annotations", | |
| ":jcip_annotations", | |
| ":jsr305", | |
| "@maven//:com_google_guava_failureaccess", | |
| "@maven//:com_google_guava_guava", | |
| ], | |
| ) | |
| license( | |
| name = "guava_license", | |
| package_name = "guava/31.1", | |
| license_kinds = [ | |
| "@rules_license//licenses/spdx:Apache-2.0", | |
| ], | |
| license_text = "guava/LICENSE", | |
| ) | |
| java_library( | |
| name = "flogger", | |
| applicable_licenses = [":flogger_license"], | |
| exports = [ | |
| "@maven//:com_google_flogger_flogger", | |
| "@maven//:com_google_flogger_flogger_system_backend", | |
| "@maven//:com_google_flogger_google_extensions", | |
| ], | |
| ) | |
| license( | |
| name = "flogger_license", | |
| package_name = "flogger/0.5.1", | |
| license_kinds = [ | |
| "@rules_license//licenses/spdx:Apache-2.0", | |
| ], | |
| ) | |
| distrib_jar_filegroup( | |
| name = "flogger-jars", | |
| srcs = [ | |
| "@maven//:com_google_flogger_flogger_file", | |
| "@maven//:com_google_flogger_flogger_system_backend_file", | |
| "@maven//:com_google_flogger_google_extensions_file", | |
| ], | |
| enable_distributions = ["debian"], | |
| ) | |
| # For bootstrapping JavaBuilder | |
| distrib_jar_filegroup( | |
| name = "guava-jars", | |
| srcs = ["@maven//:com_google_guava_guava_file"], | |
| enable_distributions = ["debian"], | |
| ) | |
| # For desugaring the Guava jar. | |
| distrib_jar_filegroup( | |
| name = "guava-failureaccess-jar", | |
| srcs = ["@maven//:com_google_guava_failureaccess_file"], | |
| enable_distributions = ["debian"], | |
| ) | |
| alias( | |
| name = "javax_activation", | |
| actual = "@maven//:javax_activation_javax_activation_api", | |
| ) | |
| # javax.annotation.Generated is not included in the default root modules in 9, | |
| # see: http://openjdk.java.net/jeps/320. | |
| java_library( | |
| name = "javax_annotations", | |
| neverlink = 1, # @Generated is source-retention | |
| exports = ["@maven//:javax_annotation_javax_annotation_api"], | |
| ) | |
| distrib_jar_filegroup( | |
| name = "javax_annotations-jars", | |
| srcs = ["@maven//:javax_annotation_javax_annotation_api_file"], | |
| enable_distributions = ["debian"], | |
| ) | |
| alias( | |
| name = "rxjava3", | |
| actual = "@maven//:io_reactivex_rxjava3_rxjava", | |
| ) | |
| alias( | |
| name = "jsr305", | |
| actual = "@maven//:com_google_code_findbugs_jsr305", | |
| ) | |
| # For bootstrapping JavaBuilder | |
| distrib_jar_filegroup( | |
| name = "jsr305-jars", | |
| srcs = ["@maven//:com_google_code_findbugs_jsr305_file"], | |
| enable_distributions = ["debian"], | |
| ) | |
| alias( | |
| name = "jsr330_inject", | |
| actual = "@maven//:javax_inject_javax_inject", | |
| ) | |
| distrib_java_import( | |
| name = "netty", | |
| enable_distributions = ["debian"], | |
| jars = [ | |
| "@maven//:io_netty_netty_buffer_file", | |
| "@maven//:io_netty_netty_codec_file", | |
| "@maven//:io_netty_netty_codec_http2_file", | |
| "@maven//:io_netty_netty_codec_http_file", | |
| "@maven//:io_netty_netty_common_file", | |
| "@maven//:io_netty_netty_handler_file", | |
| "@maven//:io_netty_netty_handler_proxy_file", | |
| "@maven//:io_netty_netty_resolver_file", | |
| "@maven//:io_netty_netty_resolver_dns_file", | |
| "@maven//:io_netty_netty_transport_file", | |
| "@maven//:io_netty_netty_transport_classes_epoll_file", | |
| "@maven//:io_netty_netty_transport_classes_kqueue_file", | |
| ] + select({ | |
| "//src/conditions:darwin_arm64": ["@maven//:io_netty_netty_transport_native_unix_common_osx_aarch_64_file"], | |
| "//src/conditions:darwin_x86_64": ["@maven//:io_netty_netty_transport_native_unix_common_osx_x86_64_file"], | |
| "//src/conditions:linux_aarch64": ["@maven//:io_netty_netty_transport_native_unix_common_linux_aarch_64_file"], | |
| "//src/conditions:linux_x86_64": ["@maven//:io_netty_netty_transport_native_unix_common_linux_x86_64_file"], | |
| "//conditions:default": ["@maven//:io_netty_netty_transport_native_unix_common_file"], | |
| }) + select({ | |
| "//src/conditions:darwin_arm64": ["@maven//:io_netty_netty_transport_native_kqueue_osx_aarch_64_file"], | |
| "//src/conditions:darwin_x86_64": ["@maven//:io_netty_netty_transport_native_kqueue_osx_x86_64_file"], | |
| "//conditions:default": [], | |
| }) + select({ | |
| "//src/conditions:linux_aarch64": ["@maven//:io_netty_netty_transport_native_epoll_linux_aarch_64_file"], | |
| "//src/conditions:linux_x86_64": ["@maven//:io_netty_netty_transport_native_epoll_linux_x86_64_file"], | |
| "//conditions:default": [], | |
| }), | |
| ) | |
| alias( | |
| name = "java-diff-utils", | |
| actual = "@maven//:io_github_java_diff_utils_java_diff_utils", | |
| ) | |
| # Testing | |
| alias( | |
| name = "compile_testing", | |
| testonly = 1, | |
| actual = "@maven//:com_google_testing_compile_compile_testing", | |
| ) | |
| alias( | |
| name = "guava-testlib", | |
| testonly = 1, | |
| actual = "@maven//:com_google_guava_guava_testlib", | |
| ) | |
| # Not test_only due to //src/java_tools/junitrunner/java/com/google/testing/junit/junit4:runner | |
| java_library( | |
| name = "junit4", | |
| exports = [ | |
| "@maven//:junit_junit", | |
| "@maven//:org_hamcrest_hamcrest_core", | |
| ], | |
| ) | |
| alias( | |
| name = "jimfs", | |
| testonly = 1, | |
| actual = "@maven//:com_google_jimfs_jimfs", | |
| ) | |
| alias( | |
| name = "mockito", | |
| testonly = 1, | |
| actual = "@maven//:org_mockito_mockito_core", | |
| ) | |
| alias( | |
| name = "turbine_direct", | |
| actual = "@maven//:com_google_turbine_turbine", | |
| ) | |
| alias( | |
| name = "turbine", | |
| actual = "@maven//:com_google_turbine_turbine", | |
| ) | |
| java_library( | |
| name = "truth", | |
| testonly = 1, | |
| exports = [ | |
| "@maven//:com_google_truth_extensions_truth_java8_extension", | |
| "@maven//:com_google_truth_extensions_truth_proto_extension", | |
| "@maven//:com_google_truth_truth", | |
| ], | |
| ) | |
| alias( | |
| name = "xz", | |
| actual = "@maven//:org_tukaani_xz", | |
| ) | |
| # To be used by the starlark example. | |
| filegroup( | |
| name = "junit4-jars", | |
| srcs = [ | |
| "@maven//:junit_junit_file", | |
| "@maven//:org_hamcrest_hamcrest_core_file", | |
| ], | |
| ) | |
| java_library( | |
| name = "jmh", | |
| exported_plugins = [":jmh_benchmark_processor"], | |
| exports = ["@maven//:org_openjdk_jmh_jmh_core"], | |
| ) | |
| java_plugin( | |
| name = "jmh_benchmark_processor", | |
| processor_class = "org.openjdk.jmh.generators.BenchmarkProcessor", | |
| visibility = ["//visibility:private"], | |
| deps = ["@maven//:org_openjdk_jmh_jmh_generator_annprocess"], | |
| ) |