Add genrule exposing java test proto srcjar and jars for gencode runtime tests from another branch

25.x-allow-compat-test
Sandy Zhang 3 months ago
parent 8a60b6527a
commit 0706804dea
  1. 69
      java/core/BUILD.bazel

@ -540,3 +540,72 @@ pkg_files(
strip_prefix = strip_prefix.from_root(""),
visibility = ["//java:__pkg__"],
)
# Genrules to expose test gencode srcjars / jars for testing compatibility of old gencode against newer runtimes.
genrule(
name = "generic_test_protos_java_proto_srcjar",
srcs = [
"//java/core:java_test_protos_java_proto",
"//java/core:generic_test_protos_java_proto",
"//java/core:lite_test_protos_java_proto",
],
outs = [
"java_test_protos-speed.srcjar",
"generic_test_protos-speed.srcjar",
"lite_test_protos-speed.srcjar",
],
visibility = [
"//visibility:public",
],
cmd = """
for location in $(locations //java/core:java_test_protos_java_proto); do
if [[ $$(basename $$location) == 'java_test_protos-speed-src.jar' ]]; then
cp $$location $(location java_test_protos-speed.srcjar);
fi
done;
for location in $(locations //java/core:generic_test_protos_java_proto); do
if [[ $$(basename $$location) == 'generic_test_protos-speed-src.jar' ]]; then
cp $$location $(location generic_test_protos-speed.srcjar);
fi
done;
for location in $(locations //java/core:lite_test_protos_java_proto); do
if [[ $$(basename $$location) == 'lite_test_protos-speed-src.jar' ]]; then
cp $$location $(location lite_test_protos-speed.srcjar);
fi
done;
""",
)
genrule(
name = "generic_test_protos_java_proto_jar",
srcs = [
"//java/core:java_test_protos_java_proto",
"//java/core:generic_test_protos_java_proto",
"//java/core:lite_test_protos_java_proto",
],
outs = [
"libjava_test_protos-speed.jar",
"libgeneric_test_protos-speed.jar",
"liblite_test_protos-speed.jar",
],
visibility = [
"//visibility:public",
],
cmd = """
for location in $(locations //java/core:java_test_protos_java_proto); do
if [[ $$(basename $$location) == 'libjava_test_protos-speed.jar' ]]; then
cp $$location $(location libjava_test_protos-speed.jar);
fi
done;
for location in $(locations //java/core:generic_test_protos_java_proto); do
if [[ $$(basename $$location) == 'libgeneric_test_protos-speed.jar' ]]; then
cp $$location $(location libgeneric_test_protos-speed.jar);
fi
done;
for location in $(locations //java/core:lite_test_protos_java_proto); do
if [[ $$(basename $$location) == 'liblite_test_protos-speed.jar' ]]; then
cp $$location $(location liblite_test_protos-speed.jar);
fi
done;
""",
)
Loading…
Cancel
Save