I have a library that provides code and data (called datalib
). In a separate kotlin library called foo
I create a target foolib
that depends on //datalib
. I create another kt_jvm_library named footest-deps
that exports :foolib
.
I then have a test that tries to use datalib
(which reads data via Runfiles). If the test depends on :foolib
it works, if the test depends on :footest-deps
it fails to locate the data. It seems that a library which exports things doesn't allow/make the data from other libraries available.
To reproduce, clone this repo (tested with JDK17), and run bazel test //foo:AllTests
. It will fail. If you modify foo/BUILD.bazel
so the test depends on :foolib
it will pass.