From 7bd19d90a97b4399eb2cf96190329ccd27b8ac05 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 3 Oct 2024 17:06:34 -0700 Subject: [PATCH] Strip versioned module-info.class files The latest errorprone updates use a multi-release jar file: https://github.com/google/error-prone/issues/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 --- java/builder.go | 1 + 1 file changed, 1 insertion(+) diff --git a/java/builder.go b/java/builder.go index 81b0feb75..6144832b3 100644 --- a/java/builder.go +++ b/java/builder.go @@ -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")