From 5c2114591503d6b320f4a613619fb2e42c17d069 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 15 Jul 2021 12:42:44 +0100 Subject: Revert "Export implementation class jars for java_boot_libs" This reverts commit 22ff0aaf51bdd9409eafe74151decb58f47308bc. The workaround to support hidden API generation with prebuilts by passing the full implementation jars through to the SDK snapshot is no longer needed as the monolithic hidden API flag generation uses the prebuilt flag files that are already part of the snapshot. This change reverts that previous workaround. Bug: 192868581 Test: - Update the prebuilts DIST_DIR=$PWD/dist TARGET_BUILD_VARIANT=userdebug art/build/build-art-module.sh --skip-apex packages/modules/ArtPrebuilt/update-art-module-prebuilts.py --local-dist=dist --skip-cls --skip-apex - Build hidden API flags to make sure it does not fail Change-Id: Idb3fde6f7dcb171677316d8794a4af91ede1f7e0 --- java/java.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index bd059b563..e20ef9e06 100644 --- a/java/java.go +++ b/java/java.go @@ -130,11 +130,19 @@ var ( PropertyName: "java_boot_libs", SupportsSdk: true, }, - // Temporarily export implementation classes jar for java_boot_libs as it is required for the - // hiddenapi processing. - // TODO(b/179354495): Revert once hiddenapi processing has been modularized. - exportImplementationClassesJar, - sdkSnapshotFilePathForJar, + func(ctx android.SdkMemberContext, j *Library) android.Path { + // Java boot libs are only provided in the SDK to provide access to their dex implementation + // jar for use by dexpreopting and boot jars package check. They do not need to provide an + // actual implementation jar but the java_import will need a file that exists so just copy an + // empty file. Any attempt to use that file as a jar will cause a build error. + return ctx.SnapshotBuilder().EmptyFile() + }, + func(osPrefix, name string) string { + // Create a special name for the implementation jar to try and provide some useful information + // to a developer that attempts to compile against this. + // TODO(b/175714559): Provide a proper error message in Soong not ninja. + return filepath.Join(osPrefix, "java_boot_libs", "snapshot", "jars", "are", "invalid", name+jarFileSuffix) + }, onlyCopyJarToSnapshot, } -- cgit v1.2.3-59-g8ed1b