Skip to content

Commit

Permalink
Strip versioned module-info.class files
Browse files Browse the repository at this point in the history
The latest errorprone updates use a multi-release jar file:
google/error-prone#3756
https://openjdk.org/jeps/238

The module-info.class existing under certain version folders caused
package-check.sh to fail. Currently errorprone only has a versioned
module-info.class file, but if it later adds versioned implementation
classes, we may also need to update package-check.sh to respect
multi-release jars.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true out/soong/.intermediates/packages/modules/Media/apex/framework/updatable-media/android_common/package-check.stamp with errorprone update to 3.32.0
Change-Id: Ieaee73636aa5321494c14c221d38964e1b0cebb1
  • Loading branch information
Colecf committed Oct 4, 2024
1 parent 3232537 commit 7bd19d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions java/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ func TransformJarsToJar(ctx android.ModuleContext, outputFile android.WritablePa
// Remove any module-info.class files that may have come from prebuilt jars, they cause problems
// for downstream tools like desugar.
jarArgs = append(jarArgs, "-stripFile module-info.class")
jarArgs = append(jarArgs, "-stripFile META-INF/versions/*/module-info.class")

if stripDirEntries {
jarArgs = append(jarArgs, "-D")
Expand Down

0 comments on commit 7bd19d9

Please sign in to comment.