summaryrefslogtreecommitdiff
path: root/java/hiddenapi_modular.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-07-01 10:55:16 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-07-01 10:55:16 +0000
commit4b51e27046c4cb5e2d3024d329ff1ccd13d7b767 (patch)
tree9c0320588e368dd49d53d55435d54995efa61129 /java/hiddenapi_modular.go
parent39924233e0679fa072366570774b16b8242b4c43 (diff)
parentef083c9556c53738e5d7a3ab791c49ef00501f73 (diff)
Merge "Defer error reporting of missing prebuilt dex jar files"
Diffstat (limited to 'java/hiddenapi_modular.go')
-rw-r--r--java/hiddenapi_modular.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go
index af124842c..c4832d2f8 100644
--- a/java/hiddenapi_modular.go
+++ b/java/hiddenapi_modular.go
@@ -1161,6 +1161,14 @@ func deferReportingMissingBootDexJar(ctx android.ModuleContext, module android.M
return true
}
+ // A bootclasspath module that is part of a versioned sdk never provides a boot dex jar as there
+ // is no equivalently versioned prebuilt APEX file from which it can be obtained. However,
+ // versioned bootclasspath modules are processed by Soong so in order to avoid them causing build
+ // failures missing boot dex jars need to be deferred.
+ if android.IsModuleInVersionedSdk(ctx.Module()) {
+ return true
+ }
+
// This is called for both platform_bootclasspath and bootclasspath_fragment modules.
//
// A bootclasspath_fragment module should only use the APEX variant of source or prebuilt modules.
@@ -1197,6 +1205,14 @@ func deferReportingMissingBootDexJar(ctx android.ModuleContext, module android.M
//
// TODO(b/187910671): Remove this once platform variants are no longer created unnecessarily.
if android.IsModulePrebuilt(module) {
+ // An inactive source module can still contribute to the APEX but an inactive prebuilt module
+ // should not contribute to anything. So, rather than have a missing dex jar cause a Soong
+ // failure defer the error reporting to Ninja. Unless the prebuilt build target is explicitly
+ // built Ninja should never use the dex jar file.
+ if !isActiveModule(module) {
+ return true
+ }
+
if am, ok := module.(android.ApexModule); ok && am.InAnyApex() {
apexInfo := ctx.OtherModuleProvider(module, android.ApexInfoProvider).(android.ApexInfo)
if apexInfo.IsForPlatform() {
@@ -1205,14 +1221,6 @@ func deferReportingMissingBootDexJar(ctx android.ModuleContext, module android.M
}
}
- // A bootclasspath module that is part of a versioned sdk never provides a boot dex jar as there
- // is no equivalently versioned prebuilt APEX file from which it can be obtained. However,
- // versioned bootclasspath modules are processed by Soong so in order to avoid them causing build
- // failures missing boot dex jars need to be deferred.
- if android.IsModuleInVersionedSdk(ctx.Module()) {
- return true
- }
-
return false
}