Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add assets to kt_android_local_test #1133

Open
pswaminathan opened this issue Mar 14, 2024 · 2 comments
Open

Can't add assets to kt_android_local_test #1133

pswaminathan opened this issue Mar 14, 2024 · 2 comments

Comments

@pswaminathan
Copy link
Contributor

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.

@Bencodes
Copy link
Collaborator

@pswaminathan is this one fixed for you with #1122 and if so can we close out this issue?

@pswaminathan
Copy link
Contributor Author

@Bencodes no—this is about how the underlying _kt_android_artifact is instantiated. With or without #1122 this doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants