forked from bazel-contrib/rules_jvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bazel-contrib#104): Allow custom package prefixes
- Loading branch information
Showing
5 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
java/test/custom/github/bazel_contrib/contrib_rules_jvm/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
load("@rules_jvm_external//:defs.bzl", "artifact") | ||
load("//java:defs.bzl", "java_test_suite", "junit5_deps") | ||
|
||
# Ignore this directory because of the wrong package name. | ||
# gazelle:ignore | ||
|
||
PACKAGE_PREFIX_NAME_TEST = [ | ||
"CustomPackageNameTest.java", | ||
] | ||
|
||
# Test that we can set known package prefixes. We do this by | ||
# setting the `package_prefixes` property, overriding the | ||
# assumed known prefixes | ||
java_test_suite( | ||
name = "custom-prefix-tests", | ||
size = "small", | ||
srcs = PACKAGE_PREFIX_NAME_TEST, | ||
package_prefixes = [".custom."], | ||
runner = "junit5", | ||
deps = [ | ||
artifact("org.junit.jupiter:junit-jupiter-api", "contrib_rules_jvm_tests"), | ||
] + junit5_deps("contrib_rules_jvm_tests"), | ||
) |
13 changes: 13 additions & 0 deletions
13
java/test/custom/github/bazel_contrib/contrib_rules_jvm/CustomPackageNameTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Note: the package name is not the same as the directory name for a reason. | ||
// See this package's `BUILD.bazel` file for more information | ||
package custom.github.bazel_contrib.contrib_rules_jvm; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class CustomPackageNameTest { | ||
|
||
@Test | ||
void shouldBeAbleToBeRun() { | ||
// This test does nothing | ||
} | ||
} |