You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update resource_strip_prefix logic to support path handling across modules (#1389)
* Add nested module resources example and update resource_strip_prefix handling
- Add an example with a nested module structure
- Update `resource_strip_prefix` logic to support path handling across modules
* Fix
* Write unit tests
* Fix test
Copy file name to clipboardExpand all lines: docs/kotlin.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ It is appropriate for building workspace utilities. `java_binary` should be pref
70
70
| <aid="kt_jvm_binary-module_name"></a>module_name | The name of the module, if not provided the module name is derived from the label. --e.g., `//some/package/path:label_name` is translated to `some_package_path-label_name`. | String | optional |`""`|
| <aid="kt_jvm_binary-resource_jars"></a>resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
73
-
| <aid="kt_jvm_binary-resource_strip_prefix"></a>resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention. |String | optional |`""`|
73
+
| <aid="kt_jvm_binary-resource_strip_prefix"></a>resource_strip_prefix | The path prefix to strip from Java resources. Should be a label pointing to a directory. Files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention if this is not specified. |<ahref="https://bazel.build/concepts/labels">Label</a> | optional |`None`|
74
74
| <aid="kt_jvm_binary-runtime_deps"></a>runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
75
75
76
76
@@ -166,7 +166,7 @@ This rule compiles and links Kotlin and Java sources into a .jar file.
166
166
| <aid="kt_jvm_library-neverlink"></a>neverlink | If true only use this library for compilation and not at runtime. | Boolean | optional |`False`|
| <aid="kt_jvm_library-resource_jars"></a>resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
169
-
| <aid="kt_jvm_library-resource_strip_prefix"></a>resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention. |String | optional |`""`|
169
+
| <aid="kt_jvm_library-resource_strip_prefix"></a>resource_strip_prefix | The path prefix to strip from Java resources. Should be a label pointing to a directory. Files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention if this is not specified. |<ahref="https://bazel.build/concepts/labels">Label</a> | optional |`None`|
170
170
| <aid="kt_jvm_library-runtime_deps"></a>runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
171
171
172
172
@@ -209,7 +209,7 @@ Setup a simple kotlin_test.
209
209
| <aid="kt_jvm_test-module_name"></a>module_name | The name of the module, if not provided the module name is derived from the label. --e.g., `//some/package/path:label_name` is translated to `some_package_path-label_name`. | String | optional |`""`|
| <aid="kt_jvm_test-resource_jars"></a>resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
212
-
| <aid="kt_jvm_test-resource_strip_prefix"></a>resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention. |String | optional |`""`|
212
+
| <aid="kt_jvm_test-resource_strip_prefix"></a>resource_strip_prefix | The path prefix to strip from Java resources. Should be a label pointing to a directory. Files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention if this is not specified. |<ahref="https://bazel.build/concepts/labels">Label</a> | optional |`None`|
213
213
| <aid="kt_jvm_test-runtime_deps"></a>runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
214
214
| <aid="kt_jvm_test-test_class"></a>test_class | The Java class to be loaded by the test runner. | String | optional |`""`|
This example tests **resource path resolution across Bazel module boundaries** when using `resource_strip_prefix`.
6
+
7
+
## Problem Statement
8
+
9
+
When a target in one Bazel module depends on a library in an external Bazel module that has resources with a custom `resource_strip_prefix`, the resource paths need to be correctly resolved.
0 commit comments