aboutsummaryrefslogtreecommitdiff
path: root/tests/analysis/compiler_plugin/propagation/BUILD
diff options
context:
space:
mode:
authornickreid <nickreid@google.com>2022-07-29 10:01:34 -0700
committerCopybara-Service <copybara-worker@google.com>2022-07-29 10:02:02 -0700
commit09d89590f3f7e36b2c5d7c7fcfd7791e8bbb17eb (patch)
tree72279136b16dc6603a93c387ad784f9265a49b99 /tests/analysis/compiler_plugin/propagation/BUILD
parentcb486c326eacd22dad98160fb36d0b706e10fbbb (diff)
downloadbazelbuild-kotlin-rules-09d89590f3f7e36b2c5d7c7fcfd7791e8bbb17eb.tar.gz
Define kt_compiler_plugin rule for kotlinc plugins.
PiperOrigin-RevId: 464101180 Change-Id: If46a509f5c830096dc47d6d74daab110e2000cbf
Diffstat (limited to 'tests/analysis/compiler_plugin/propagation/BUILD')
-rw-r--r--tests/analysis/compiler_plugin/propagation/BUILD79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/analysis/compiler_plugin/propagation/BUILD b/tests/analysis/compiler_plugin/propagation/BUILD
new file mode 100644
index 0000000..bf1896e
--- /dev/null
+++ b/tests/analysis/compiler_plugin/propagation/BUILD
@@ -0,0 +1,79 @@
+# Copyright 2022 Google LLC. 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.
+
+load("@//kotlin:compiler_plugin.bzl", "kt_compiler_plugin")
+load(":assert_propagation_test.bzl", "assert_propagation_test")
+
+licenses(["notice"])
+
+assert_propagation_test(
+ name = "f",
+ expected_plugin_ids = ["1"],
+ deps = [":e"],
+)
+
+assert_propagation_test(
+ name = "e",
+ expected_plugin_ids = [],
+ exports = [":a"],
+)
+
+assert_propagation_test(
+ name = "d",
+ expected_plugin_ids = [
+ "1",
+ "2",
+ ],
+ deps = [
+ ":a",
+ ":b",
+ ],
+)
+
+assert_propagation_test(
+ name = "c",
+ expected_plugin_ids = ["2"],
+ deps = [":b"],
+)
+
+assert_propagation_test(
+ name = "b",
+ expected_plugin_ids = ["1"],
+ exported_plugins = [":2"],
+ deps = [":a"],
+)
+
+assert_propagation_test(
+ name = "a",
+ expected_plugin_ids = [],
+ exported_plugins = [":1"],
+)
+
+kt_compiler_plugin(
+ name = "1",
+ jar = "@//tests/analysis/compiler_plugin:empty_jar",
+ plugin_id = "1",
+)
+
+kt_compiler_plugin(
+ name = "2",
+ jar = "@//tests/analysis/compiler_plugin:empty_jar",
+ plugin_id = "2",
+)
+
+kt_compiler_plugin(
+ name = "3",
+ jar = "@//tests/analysis/compiler_plugin:empty_jar",
+ plugin_id = "3",
+)