From 49ac11d298ba372069b96c4ac6f44c6143b68fe6 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Fri, 3 May 2024 17:21:32 +0100 Subject: [PATCH] Try shorter paths --- .../src/test/com/example/gazelle/BUILD.bazel | 15 +++++++++++ .../gazelle/ExampleTest.java | 2 +- .../gazelle/expected-query-output | 0 .../examples/gazelle/BUILD.bazel | 27 ------------------- 4 files changed, 16 insertions(+), 28 deletions(-) create mode 100644 examples/gazelle/src/test/com/example/gazelle/BUILD.bazel rename examples/gazelle/src/test/com/{github/bazel_contrib/contrib_rules_jvm/examples => example}/gazelle/ExampleTest.java (59%) rename examples/gazelle/src/test/com/{github/bazel_contrib/contrib_rules_jvm/examples => example}/gazelle/expected-query-output (100%) delete mode 100644 examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel diff --git a/examples/gazelle/src/test/com/example/gazelle/BUILD.bazel b/examples/gazelle/src/test/com/example/gazelle/BUILD.bazel new file mode 100644 index 00000000..ce1daf34 --- /dev/null +++ b/examples/gazelle/src/test/com/example/gazelle/BUILD.bazel @@ -0,0 +1,15 @@ +load("@contrib_rules_jvm//java:defs.bzl", "java_test_suite") +load("@bazel_skylib//rules:diff_test.bzl", "diff_test") + +genquery( + name = "generated_targets", + expression = "kind(java_test, deps(//src/test/com/example/gazelle:gazelle))", + opts = ["--output=label_kind"], + scope = ["//src/test/com/example/gazelle"], +) + +diff_test( + name = "diff_test", + file1 = ":generated_targets", + file2 = ":expected-query-output", +) diff --git a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/ExampleTest.java b/examples/gazelle/src/test/com/example/gazelle/ExampleTest.java similarity index 59% rename from examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/ExampleTest.java rename to examples/gazelle/src/test/com/example/gazelle/ExampleTest.java index 167bb956..c29e412d 100644 --- a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/ExampleTest.java +++ b/examples/gazelle/src/test/com/example/gazelle/ExampleTest.java @@ -1,4 +1,4 @@ -package com.github.bazel_contrib.contrib_rules_jvm.examples.gazelle; +package com.example.gazelle; import org.junit.jupiter.api.Test; diff --git a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/expected-query-output b/examples/gazelle/src/test/com/example/gazelle/expected-query-output similarity index 100% rename from examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/expected-query-output rename to examples/gazelle/src/test/com/example/gazelle/expected-query-output diff --git a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel b/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel deleted file mode 100644 index 5718724f..00000000 --- a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel +++ /dev/null @@ -1,27 +0,0 @@ -load("@contrib_rules_jvm//java:defs.bzl", "java_test_suite") -load("@bazel_skylib//rules:diff_test.bzl", "diff_test") - -genquery( - name = "generated_targets", - expression = "kind(java_test, deps(//src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle:gazelle))", - opts = ["--output=label_kind"], - scope = ["//src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle"], -) - -diff_test( - name = "diff_test", - file1 = ":generated_targets", - file2 = ":expected-query-output", -) - -java_test_suite( - name = "gazelle", - srcs = ["ExampleTest.java"], - runner = "junit5", - runtime_deps = [ - "@maven//:org_junit_jupiter_junit_jupiter_engine", - "@maven//:org_junit_platform_junit_platform_launcher", - "@maven//:org_junit_platform_junit_platform_reporting", - ], - deps = ["@maven//:org_junit_jupiter_junit_jupiter_api"], -)