aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlises Mendez Martinez <umendez@google.com>2023-04-19 11:12:13 +0000
committerUlises Mendez Martinez <umendez@google.com>2023-04-19 16:54:30 +0000
commit31ceaa821a919d3b931588ac7ec17fed72184d50 (patch)
tree9fc58758036545a844bd37390f2976322c6aceb8
parent707b2c5fe3d0d7d934a93e00a8a4062e83557831 (diff)
downloadbazel_common_rules-31ceaa821a919d3b931588ac7ec17fed72184d50.tar.gz
Move rules_java to bazel_common_rules
This will benefit other projects like Kleaf. Bug: 245624185 Change-Id: Ib495112628e32b98a430ac127b8b367fa36be2e7 Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
-rw-r--r--rules/java/rules_java/BUILD0
-rw-r--r--rules/java/rules_java/WORKSPACE0
-rw-r--r--rules/java/rules_java/java/BUILD23
-rw-r--r--rules/java/rules_java/java/defs.bzl47
4 files changed, 70 insertions, 0 deletions
diff --git a/rules/java/rules_java/BUILD b/rules/java/rules_java/BUILD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/rules/java/rules_java/BUILD
diff --git a/rules/java/rules_java/WORKSPACE b/rules/java/rules_java/WORKSPACE
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/rules/java/rules_java/WORKSPACE
diff --git a/rules/java/rules_java/java/BUILD b/rules/java/rules_java/java/BUILD
new file mode 100644
index 0000000..e7d4265
--- /dev/null
+++ b/rules/java/rules_java/java/BUILD
@@ -0,0 +1,23 @@
+"""
+Copyright (C) 2023 The Android Open Source Project
+
+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.
+"""
+
+load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
+
+bzl_library(
+ name = "rules",
+ srcs = ["defs.bzl"],
+ visibility = ["//visibility:public"],
+)
diff --git a/rules/java/rules_java/java/defs.bzl b/rules/java/rules_java/java/defs.bzl
new file mode 100644
index 0000000..33d1ab3
--- /dev/null
+++ b/rules/java/rules_java/java/defs.bzl
@@ -0,0 +1,47 @@
+# Copyright (C) 2023 The Android Open Source Project
+#
+# 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.
+
+"""
+Helper macros to forward to native equivalents.
+"""
+
+def java_binary(**attrs):
+ native.java_binary(**attrs)
+
+def java_import(**attrs):
+ native.java_import(**attrs)
+
+def java_library(**attrs):
+ native.java_library(**attrs)
+
+def java_lite_proto_library(**attrs):
+ native.java_lite_proto_library(**attrs)
+
+def java_proto_library(**attrs):
+ native.java_proto_library(**attrs)
+
+def java_test(**attrs):
+ native.java_test(**attrs)
+
+def java_package_configuration(**attrs):
+ native.java_package_configuration(**attrs)
+
+def java_plugin(**attrs):
+ native.java_plugin(**attrs)
+
+def java_runtime(**attrs):
+ native.java_runtime(**attrs)
+
+def java_toolchain(**attrs):
+ native.java_toolchain(**attrs)