Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bd19d90 authored by Cole Faust's avatar Cole Faust
Browse files

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
parent 32325372
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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")