Remove migration tags pollution in the `java_*` rules Given the alternative mechanism of inspecting the callstack for the invocation location, this is no longer needed. PiperOrigin-RevId: 610399903 Change-Id: I29a2c222c58b13e2f09b00e9a4741a32110fa9ab
diff --git a/java/java_binary.bzl b/java/java_binary.bzl index 18f5b86..b35064c 100644 --- a/java/java_binary.bzl +++ b/java/java_binary.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_binary rule""" -load("//java/private:add_tags.bzl", "add_tags") - # Do not touch: This line marks the end of loads; needed for PR importing. def java_binary(**attrs): @@ -27,4 +25,4 @@ """ # buildifier: disable=native-java - native.java_binary(**add_tags(attrs)) + native.java_binary(**attrs)
diff --git a/java/java_import.bzl b/java/java_import.bzl index dd23653..24a52af 100644 --- a/java/java_import.bzl +++ b/java/java_import.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_import rule""" -load("//java/private:add_tags.bzl", "add_tags") - def java_import(**attrs): """Bazel java_import rule. @@ -25,4 +23,4 @@ """ # buildifier: disable=native-java - native.java_import(**add_tags(attrs)) + native.java_import(**attrs)
diff --git a/java/java_library.bzl b/java/java_library.bzl index 3bc0a53..2dff6d6 100644 --- a/java/java_library.bzl +++ b/java/java_library.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_library rule""" -load("//java/private:add_tags.bzl", "add_tags") - # Do not touch: This line marks the end of loads; needed for PR importing. def java_library(**attrs): @@ -27,4 +25,4 @@ """ # buildifier: disable=native-java - native.java_library(**add_tags(attrs)) + native.java_library(**attrs)
diff --git a/java/java_plugin.bzl b/java/java_plugin.bzl index a95fc44..e26ae04 100644 --- a/java/java_plugin.bzl +++ b/java/java_plugin.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_plugin rule""" -load("//java/private:add_tags.bzl", "add_tags") - def java_plugin(**attrs): """Bazel java_plugin rule. @@ -25,4 +23,4 @@ """ # buildifier: disable=native-java - native.java_plugin(**add_tags(attrs)) + native.java_plugin(**attrs)
diff --git a/java/java_test.bzl b/java/java_test.bzl index 76a63a1..7064b5b 100644 --- a/java/java_test.bzl +++ b/java/java_test.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_test rule""" -load("//java/private:add_tags.bzl", "add_tags") - # Do not touch: This line marks the end of loads; needed for PR importing. def java_test(**attrs): @@ -27,4 +25,4 @@ """ # buildifier: disable=native-java - native.java_test(**add_tags(attrs)) + native.java_test(**attrs)
diff --git a/java/private/BUILD b/java/private/BUILD index 444264d..c1eb833 100644 --- a/java/private/BUILD +++ b/java/private/BUILD
@@ -5,7 +5,6 @@ bzl_library( name = "private", srcs = [ - "add_tags.bzl", "native.bzl", ], visibility = ["//java:__subpackages__"],
diff --git a/java/private/add_tags.bzl b/java/private/add_tags.bzl deleted file mode 100644 index 6f2e35b..0000000 --- a/java/private/add_tags.bzl +++ /dev/null
@@ -1,23 +0,0 @@ -# Copyright 2023 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""add_tags migration helper""" - -_MIGRATION_TAG = "__JAVA_RULES_MIGRATION_DO_NOT_USE_WILL_BREAK__" - -def add_tags(attrs): - if "tags" in attrs and attrs["tags"] != None: - attrs["tags"] = attrs["tags"] + [_MIGRATION_TAG] - else: - attrs["tags"] = [_MIGRATION_TAG] - return attrs
diff --git a/java/proto/java_lite_proto_library.bzl b/java/proto/java_lite_proto_library.bzl index c800237..22dd7ab 100644 --- a/java/proto/java_lite_proto_library.bzl +++ b/java/proto/java_lite_proto_library.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_lite_proto_library rule""" -load("//java/private:add_tags.bzl", "add_tags") - def java_lite_proto_library(**attrs): """Bazel java_lite_proto_library rule. @@ -25,4 +23,4 @@ """ # buildifier: disable=native-java - native.java_lite_proto_library(**add_tags(attrs)) + native.java_lite_proto_library(**attrs)
diff --git a/java/proto/java_proto_library.bzl b/java/proto/java_proto_library.bzl index cb3d3f5..fbe9945 100644 --- a/java/proto/java_proto_library.bzl +++ b/java/proto/java_proto_library.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_proto_library rule""" -load("//java/private:add_tags.bzl", "add_tags") - def java_proto_library(**attrs): """Bazel java_proto_library rule. @@ -25,4 +23,4 @@ """ # buildifier: disable=native-java - native.java_proto_library(**add_tags(attrs)) + native.java_proto_library(**attrs)
diff --git a/java/toolchains/java_package_configuration.bzl b/java/toolchains/java_package_configuration.bzl index b68b5fc..09d8e1e 100644 --- a/java/toolchains/java_package_configuration.bzl +++ b/java/toolchains/java_package_configuration.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_package_configuration rule""" -load("//java/private:add_tags.bzl", "add_tags") - def java_package_configuration(**attrs): """Bazel java_package_configuration rule. @@ -25,4 +23,4 @@ """ # buildifier: disable=native-java - native.java_package_configuration(**add_tags(attrs)) + native.java_package_configuration(**attrs)
diff --git a/java/toolchains/java_runtime.bzl b/java/toolchains/java_runtime.bzl index 0f2eb8b..3657a88 100644 --- a/java/toolchains/java_runtime.bzl +++ b/java/toolchains/java_runtime.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_runtime rule""" -load("//java/private:add_tags.bzl", "add_tags") - def java_runtime(**attrs): """Bazel java_runtime rule. @@ -25,4 +23,4 @@ """ # buildifier: disable=native-java - native.java_runtime(**add_tags(attrs)) + native.java_runtime(**attrs)
diff --git a/java/toolchains/java_toolchain.bzl b/java/toolchains/java_toolchain.bzl index a5f1cda..5b07292 100644 --- a/java/toolchains/java_toolchain.bzl +++ b/java/toolchains/java_toolchain.bzl
@@ -13,8 +13,6 @@ # limitations under the License. """java_toolchain rule""" -load("//java/private:add_tags.bzl", "add_tags") - def java_toolchain(**attrs): """Bazel java_toolchain rule. @@ -25,4 +23,4 @@ """ # buildifier: disable=native-java - native.java_toolchain(**add_tags(attrs)) + native.java_toolchain(**attrs)