From f23bc472b091dd809245e9e92d42a58f849182a3 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 27 Apr 2021 12:42:20 +0100 Subject: Move configuration checks from getBootImageJar The getBootImageJar function will be removed once the boot image creation has been moved to the platform_bootclasspath and bootclasspath_fragment module types. However, the consistency checks that it performs are still useful so this change moves them out first. The ART boot image related checks are now performed in the bootclasspath_fragment module type. A previous change accidentally disabled the checks when the contents property was not empty which has been fixed. Also, the error messages have been tweaked to make it clear that the art-bootclasspath-fragment is now the source of truth as to its contents not the configuration. The framework boot image related checks are now performed in the platform_bootclasspath module type. Initially, this change included an extra check to make sure that UpdatableBootJars comes from updatable APEXes but that broke because framework-wifi and framework-tethering are not currently marked as updatable in AOSP. Bug: 177892522 Test: m nothing Change-Id: I80fb600fa2c7cec4566b3461c6a33c4c6f0743f4 --- java/bootclasspath_fragment.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'java/bootclasspath_fragment.go') diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index d7525ecce..8fe362a56 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -145,11 +145,6 @@ func bootclasspathFragmentInitContentsFromImage(ctx android.EarlyModuleContext, ctx.ModuleErrorf(`neither of the "image_name" and "contents" properties have been supplied, please supply exactly one`) } - if len(contents) != 0 { - // Nothing to do. - return - } - imageName := proptools.String(m.properties.Image_name) if imageName == "art" { // TODO(b/177892522): Prebuilts (versioned or not) should not use the image_name property. @@ -181,7 +176,7 @@ func bootclasspathFragmentInitContentsFromImage(ctx android.EarlyModuleContext, continue } if !m.AvailableFor(apex) { - ctx.ModuleErrorf("incompatible with ArtApexJars which expects this to be in apex %q but this is only in apexes %q", + ctx.ModuleErrorf("ArtApexJars configuration incompatible with this module, ArtApexJars expects this to be in apex %q but this is only in apexes %q", apex, m.ApexAvailable()) continue } @@ -193,6 +188,11 @@ func bootclasspathFragmentInitContentsFromImage(ctx android.EarlyModuleContext, } } + if len(contents) != 0 { + // Nothing to do. + return + } + // Store the jars in the Contents property so that they can be used to add dependencies. m.properties.Contents = modules.CopyOfJars() } -- cgit v1.2.3-59-g8ed1b