Skip to content

Commit

Permalink
Add src/{main,test}/java as conventional resource prefix (bazelbuil…
Browse files Browse the repository at this point in the history
…d#927)

The native `java_*` rules recognize these prefixes and emit resources
relative to it. Depending on the same resource from `java_*` or `kt_*`
should ideally behave in the same way.
  • Loading branch information
fmeum authored Mar 2, 2023
1 parent d3a23a3 commit 198c51f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kotlin/internal/jvm/compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def _collect_plugins_for_export(local, exports):
)

_CONVENTIONAL_RESOURCE_PATHS = [
"src/main/java",
"src/main/resources",
"src/test/java",
"src/test/resources",
"kotlin",
]
Expand Down
2 changes: 2 additions & 0 deletions src/test/data/jvm/basic/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ kt_jvm_library(
name = "conventional_strip_resources",
srcs = glob(["testresources/src/*.kt"]),
resources = glob([
"conventional_strip_resources/src/main/java/**/*",
"conventional_strip_resources/src/test/java/**/*",
"conventional_strip_resources/src/main/resources/**/*",
"conventional_strip_resources/src/test/resources/**/*",
]),
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class KotlinJvmBasicAssertionTest : KotlinAssertionTestCase("src/test/data/jvm/b
"conventional_strip_resources.jar",
description = "the rules should support conventional prefix stripping"
) {
assertContainsEntries("main.txt", "test.txt")
assertContainsEntries("java_main.txt", "java_test.txt", "main.txt", "test.txt")
}
}

Expand Down

0 comments on commit 198c51f

Please sign in to comment.