When a kt_jvm_library target includes a generated file (e.g. from a filegroup with output_group) in its resources attribute, the resource is embedded in the JAR with the full bazel-out/<config>/bin/... prefix rather than stripping it to the source-relative path.
In rules_kotlin 2.1.10, generated resources were embedded at their source-relative path (e.g. src/main/python/.../file.zip). In 2.2.2, they are embedded at the full output path (e.g. bazel-out/k8-fastbuild/bin/src/main/python/.../file.zip).
The <config> portion of the prefix (e.g. k8-fastbuild, k8-opt) varies by build configuration, making it impossible to hardcode the resource path.
Reproduction:
Expected: Resource at src/main/python/tools/my_file.zip inside JAR
Actual: Resource at bazel-out/k8-fastbuild/bin/src/main/python/tools/my_file.zip inside JAR
Workaround: Scan JAR entries by suffix at runtime.
Version: rules_kotlin 2.2.2 (via rules_kotlin_jvm 0.13.0)
When a
kt_jvm_librarytarget includes a generated file (e.g. from afilegroupwithoutput_group) in itsresourcesattribute, the resource is embedded in the JAR with the fullbazel-out/<config>/bin/...prefix rather than stripping it to the source-relative path.In
rules_kotlin2.1.10, generated resources were embedded at their source-relative path (e.g.src/main/python/.../file.zip). In 2.2.2, they are embedded at the full output path (e.g.bazel-out/k8-fastbuild/bin/src/main/python/.../file.zip).The
<config>portion of the prefix (e.g.k8-fastbuild,k8-opt) varies by build configuration, making it impossible to hardcode the resource path.Reproduction:
Expected: Resource at
src/main/python/tools/my_file.zipinside JARActual: Resource at
bazel-out/k8-fastbuild/bin/src/main/python/tools/my_file.zipinside JARWorkaround: Scan JAR entries by suffix at runtime.
Version: rules_kotlin 2.2.2 (via rules_kotlin_jvm 0.13.0)