From 7ebae50a7554e153905bbb3993bac32ed6024b6c Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Tue, 7 May 2024 17:47:34 +0100 Subject: [PATCH] Shorten path to example file Otherwise the diff_test fails on Windows because the path is too long. --- .../examples => example}/gazelle/BUILD.bazel | 5 +++-- .../examples => example}/gazelle/ExampleTest.java | 2 +- .../src/test/com/example/gazelle/expected-query-output | 1 + .../contrib_rules_jvm/examples/gazelle/expected-query-output | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) rename examples/gazelle/src/test/com/{github/bazel_contrib/contrib_rules_jvm/examples => example}/gazelle/BUILD.bazel (54%) rename examples/gazelle/src/test/com/{github/bazel_contrib/contrib_rules_jvm/examples => example}/gazelle/ExampleTest.java (59%) create mode 100755 examples/gazelle/src/test/com/example/gazelle/expected-query-output delete mode 100755 examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/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/example/gazelle/BUILD.bazel similarity index 54% rename from examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel rename to examples/gazelle/src/test/com/example/gazelle/BUILD.bazel index 60b833e5..ce1daf34 100644 --- a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel +++ b/examples/gazelle/src/test/com/example/gazelle/BUILD.bazel @@ -1,10 +1,11 @@ +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))", + expression = "kind(java_test, deps(//src/test/com/example/gazelle:gazelle))", opts = ["--output=label_kind"], - scope = ["//src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle"], + scope = ["//src/test/com/example/gazelle"], ) diff_test( 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/example/gazelle/expected-query-output b/examples/gazelle/src/test/com/example/gazelle/expected-query-output new file mode 100755 index 00000000..17bfe062 --- /dev/null +++ b/examples/gazelle/src/test/com/example/gazelle/expected-query-output @@ -0,0 +1 @@ +java_test rule //src/test/com/example/gazelle:ExampleTest 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/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/expected-query-output deleted file mode 100755 index 33a1ddca..00000000 --- a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/expected-query-output +++ /dev/null @@ -1 +0,0 @@ -java_test rule //src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle:ExampleTest