rules_jvm_external
rules_jvm_external copied to clipboard
The downloaded files do not have the correct extensions
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",
)