Do all dexpreoptDisabled checks before registering a dex2oat host dep.
Also disable dexpreopting for host. These are necessary to avoid adding
dependencies on dex2oat in various non-platform builds where they will
break.
Since we cannot assume at least one module enables dexpreopting now,
the two dexpreopt singletons are silently disabled if there has been no
call to dexpreopt.GetGlobalSoongConfig.
Bug: 145934348
Bug: 148312086
Bug: 148319588
Bug: 148690468
Test: m
Test: env OUT_DIR=out-tools prebuilts/build-tools/build-prebuilts.sh
on the aosp-build-tools branch
Test: build/soong/soong_ui.bash --make-mode static_sdk_tools dist DIST_DIR=out-dist BUILD_HOST_static=1
on internal (cf b/148312086#comment8)
Test: build/soong/soong_ui.bash --make-mode dist DIST_DIR=out-apps TARGET_BUILD_APPS=Launcher3 TARGET_BUILD_VARIANT=userdebug
on internal without art/ and external/vixl/ (cf b/148319588)
Change-Id: I240dade7204b87fc2d12181534ab23439eca8b46
diff --git a/java/app.go b/java/app.go
index f55fc45..02f3e7f 100755
--- a/java/app.go
+++ b/java/app.go
@@ -27,7 +27,6 @@
"android/soong/android"
"android/soong/cc"
- "android/soong/dexpreopt"
"android/soong/tradefed"
)
@@ -143,6 +142,10 @@
noticeOutputs android.NoticeOutputs
}
+func (a *AndroidApp) IsInstallable() bool {
+ return Bool(a.properties.Installable)
+}
+
func (a *AndroidApp) ExportedProguardFlagFiles() android.Paths {
return nil
}
@@ -339,7 +342,6 @@
installDir = filepath.Join("app", a.installApkName)
}
a.dexpreopter.installPath = android.PathForModuleInstall(ctx, installDir, a.installApkName+".apk")
- a.dexpreopter.isInstallable = Bool(a.properties.Installable)
a.dexpreopter.uncompressedDex = a.shouldUncompressDex(ctx)
a.dexpreopter.enforceUsesLibs = a.usesLibrary.enforceUsesLibraries()
@@ -876,7 +878,6 @@
android.ModuleBase
android.DefaultableModuleBase
prebuilt android.Prebuilt
- dexpreopt.DexPreoptModule
properties AndroidAppImportProperties
dpiVariants interface{}
@@ -924,6 +925,10 @@
Filename *string
}
+func (a *AndroidAppImport) IsInstallable() bool {
+ return true
+}
+
// Updates properties with variant-specific values.
func (a *AndroidAppImport) processVariants(ctx android.LoadHookContext) {
config := ctx.Config()
@@ -1066,7 +1071,6 @@
}
a.dexpreopter.installPath = installDir.Join(ctx, a.BaseModuleName()+".apk")
- a.dexpreopter.isInstallable = true
a.dexpreopter.isPresignedPrebuilt = Bool(a.properties.Presigned)
a.dexpreopter.uncompressedDex = a.shouldUncompressDex(ctx)