bazeltools / bazel_jar_jar

JarJar rules for bazel (rename packages and classes in existing jars)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kotlin Metadata is unchanged

thomasbao12 opened this issue · comments

Even using the latest commit 57067a1beec4ce5c7ee97ec25bb666b6fad6b160, bazel_jar_jar will not update the kotlin metadata in the bytecode.

Repro:

jar_jar(
    name = "graphql_kotlin_schema_generator_shaded",
    inline_rules = ["rule graphql.** graphql13.@1"],
    input_jar = "@maven//:com_expediagroup_graphql_kotlin_schema_generator",
    visibility = ["//visibility:private"],
)

where this is the resolved maven coordinate: ("com.expediagroup", "graphql-kotlin-schema-generator", "1.0.0-RC11").

IF you look at the shaded jar, you'll see the following

Screenshot 2024-01-24 at 4 30 00 PM Screenshot 2024-01-25 at 2 18 58 PM

Note that the import statement is changed correctly, but the kotlin metadata d2 field is not.

This will lead to compilation errors, where the inferred type and expected type do not match.