1load("@bazel_skylib//rules:build_test.bzl", "build_test") 2load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") 3load("//bazel/toolchains:proto_lang_toolchain.bzl", "proto_lang_toolchain") 4load("//conformance:defs.bzl", "conformance_test") 5load("//java/internal:testing.bzl", "junit_tests") 6 7exports_files( 8 ["lite.awk"], 9 visibility = ["//java/core:__pkg__"], 10) 11 12exports_files( 13 ["pom_template.xml"], 14 visibility = ["//java/core:__pkg__"], 15) 16 17alias( 18 name = "lite", 19 actual = "//java/core:lite", 20 visibility = ["//visibility:public"], 21) 22 23proto_lang_toolchain( 24 name = "toolchain", 25 # keep this in sync w/ LITE_WELL_KNOWN_PROTO_MAP in //:BUILD 26 blacklisted_protos = [ 27 "//:java_features_proto", 28 "//:any_proto", 29 "//:api_proto", 30 "//:duration_proto", 31 "//:empty_proto", 32 "//:field_mask_proto", 33 "//:source_context_proto", 34 "//:struct_proto", 35 "//:timestamp_proto", 36 "//:type_proto", 37 "//:wrappers_proto", 38 ], 39 command_line = "--java_out=lite:$(OUT)", 40 runtime = ":lite", 41 visibility = ["//visibility:public"], 42) 43 44test_suite( 45 name = "tests", 46 tests = [ 47 "conformance_test", 48 "lite_build_test", 49 "lite_tests", 50 "//java/core:lite_tests", 51 ], 52) 53 54build_test( 55 name = "lite_build_test", 56 targets = [ 57 ":lite", 58 ], 59) 60 61conformance_test( 62 name = "conformance_test", 63 failure_list = "//conformance:failure_list_java_lite.txt", 64 maximum_edition = "2023", 65 testee = "//conformance:conformance_java_lite", 66 text_format_failure_list = "//conformance:text_format_failure_list_java_lite.txt", 67) 68 69junit_tests( 70 name = "lite_tests", 71 size = "small", 72 srcs = glob(["src/test/**/*.java"]), 73 deps = [ 74 ":lite", 75 "//java/core:generic_test_protos_java_proto_lite", 76 "//java/core:java_test_protos_java_proto_lite", 77 "//java/core:lite_test_protos_java_proto_lite", 78 "//java/core:test_util_lite", 79 "@protobuf_maven//:com_google_truth_truth", 80 "@protobuf_maven//:junit_junit", 81 ], 82) 83 84pkg_files( 85 name = "dist_files", 86 srcs = glob([ 87 "**/*.java", 88 ]) + [ 89 "BUILD.bazel", 90 "generate-sources-build.xml", 91 "generate-test-sources-build.xml", 92 "lite.awk", 93 "pom_template.xml", 94 "process-lite-sources-build.xml", 95 ], 96 strip_prefix = strip_prefix.from_root(""), 97 visibility = ["//java:__pkg__"], 98) 99