Skip to content

Commit

Permalink
Remove META-INF/*.kotlin_module entries from the AutoValue jar.
Browse files Browse the repository at this point in the history
We bundle a shaded copy of `kotlinx.metadata.jvm` and related libraries, which we use to inspect Kotlin data classes. The libraries are only called from Java code, which means that `META-INF/kotlinx-metadata-jvm.kotlin_module` and the like serve no purpose, other than to confuse the Kotlin compiler when it sees these entries.

Fixes #1574.

RELNOTES=An "incompatible version" issue with Kotlin compilation has been fixed. See #1574.
PiperOrigin-RevId: 557209904
  • Loading branch information
eamonnmcmanus authored and Google Java Core Libraries committed Aug 15, 2023
1 parent b431b02 commit b21c7f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions value/processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@
<exclude>com.google.code.findbugs:jsr305</exclude>
</excludes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<!-- Don't include kotlinx-metadata.kotlin_module, etc. We're shading those
libaries and they're only used from Java. Leaving them in the jar creates
"incompatible version" errors from the Kotlin compiler. -->
<exclude>META-INF/*.kotlin_module</exclude>
</excludes>
</filter>
</filters>
<transformers>
<!-- Needed to avoid "No MetadataExtensions instances found in the classpath" from Kotlin reflection. -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
Expand Down

0 comments on commit b21c7f4

Please sign in to comment.