rules_kotlin
rules_kotlin copied to clipboard
Can't add assets to kt_android_local_test
In kt_android_local_test, the underlying _kt_android_artifact
doesn't get manifest
or manifest_values
if they are provided. (link) As such, adding assets
fails, because the underlying library gets the assets kwarg, but not the manifest.
Can repro with the examples:
kt_android_local_test(
name = "SomeTest",
srcs = ["SomeTest.kt"],
associates = ["//libKtAndroid:my_kt_kt"],
custom_package = "examples.android.lib",
manifest = "AndroidManifest.xml",
assets = ["assets/some_asset.txt"],
assets_dir = "assets",
deps = [
"@maven//:junit_junit",
"@robolectric//bazel:android-all",
],
)
This can be worked around by creating a kt_android_library and then making that a dep of the test, but that is fairly sub-optimal.
I can PR a fix for this, but first wanted to see if there were any concerns with passing those values.
@pswaminathan is this one fixed for you with https://github.com/bazelbuild/rules_kotlin/pull/1122 and if so can we close out this issue?
@Bencodes no—this is about how the underlying _kt_android_artifact is instantiated. With or without #1122 this doesn't work.