summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2021-07-19 09:49:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-07-19 09:49:17 +0000
commit52cc87959ba27af578bddd348baff2e826813772 (patch)
treea3f78422f83f4fac11d27f880e10fed2d865ece2 /java/java.go
parent452366ab0cbc128f209a3e28d1ed3a394bb89bba (diff)
parent5c2114591503d6b320f4a613619fb2e42c17d069 (diff)
Merge "Revert "Export implementation class jars for java_boot_libs""
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/java/java.go b/java/java.go
index 83e9fe1cb..e38a7143b 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,
}