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

The downloaded files do not have the correct extensions #684

Closed
Bencodes opened this issue Apr 22, 2022 · 5 comments
Closed

The downloaded files do not have the correct extensions #684

Bencodes opened this issue Apr 22, 2022 · 5 comments

Comments

@Bencodes
Copy link
Contributor

rules_jvm_external doesn't append the proper file extensions to the downloaded files which prevents direct consumption. This can be worked around by making a copy that has the correct file extension before passing them to java_import and aar_import.

Example: java_import asserts that the provided inputs for both jars and srcjar have .java as it's file extension. aar_import mirrors this behavior by asserting that the provided input has .aar as it's file extension.

java_import(
    name = "example_java_import",
	# Produces an error in Bazel
    jars = ["@org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm_1_6_1//file"],
	# Produces an error in Bazel
    srcjar = "@org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm_jar_sources_1_6_1//file:file",
)

aar_import(
    name = "example_aar_import",
	# Produces an error in Bazel
    aar = "@androidx_room_room_runtime_2_4_2//file",
	# Produces an error in Bazel
    srcjar = "@androidx_room_room_runtime_aar_sources_2_4_2//file",
)
@AlexBurdu
Copy link

AlexBurdu commented May 29, 2023

I'm not sure whether it's the same issue or a different one, but maven_install behaves in a similar way when trying to fetch jetpack compose artifacts, which with 1.5.0-beta01 are jars instead of aars (https://mvnrepository.com/artifact/androidx.compose.runtime/runtime/1.5.0-beta01)

load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
    artifacts = [
        "androidx.compose.runtime:runtime:1.5.0-beta01",
    ],
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)
java_library(
    name = "compose-runtime",
    exports = ["@maven//:androidx_compose_runtime_runtime"],
)
https://maven.google.com/androidx/compose/runtime/runtime/1.5.0-beta01/runtime-1.5.0-beta01.aar: not found: https://maven.google.com/androidx/compose/runtime/runtime/1.5.0-beta01/runtime-1.5.0-beta01.aar

It fetches successfully androidx.compose.runtime:runtime:1.4.3, which has aar uploaded on mvnrepository (https://mvnrepository.com/artifact/androidx.compose.runtime/runtime/1.4.3)

@Bencodes
Copy link
Contributor Author

@AlexBurdu We are also seeing this issue with beta01. This should probably be opened up as a new issue against rules_jvm_external or reported to https://issuetracker.google.com.

The original issue here is related to the downloaded files on the file system not having file extensions at all which prevents us from loading it in an aar_import where the .aar file extension is required and enforced.

@artem-zinnatullin
Copy link
Contributor

artem-zinnatullin commented May 31, 2023

Filed separate issue for Gradle Module Metadata .module files support #909

@Bencodes
Copy link
Contributor Author

Closing this issue since the original problem was solved already. Any further compose multiplatform discussion will continue in #909

@geaden
Copy link

geaden commented Dec 16, 2023

Closing this issue since the original problem was solved already. Any further compose multiplatform discussion will continue in #909

How was the original issue solved? I still get the same issue #684 (comment) when upgrading from compose 1.4.3 to 1.5.4

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

4 participants