2018-11-13 02:13:39 +08:00
|
|
|
// Copyright 2018 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package dexpreopt
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
2020-01-11 08:37:30 +08:00
|
|
|
"fmt"
|
2021-04-23 18:39:41 +08:00
|
|
|
"reflect"
|
2019-02-16 02:39:37 +08:00
|
|
|
"strings"
|
2019-02-12 07:11:14 +08:00
|
|
|
|
2020-01-11 08:37:30 +08:00
|
|
|
"github.com/google/blueprint"
|
|
|
|
|
2019-02-12 07:11:14 +08:00
|
|
|
"android/soong/android"
|
2018-11-13 02:13:39 +08:00
|
|
|
)
|
|
|
|
|
2020-01-07 07:11:37 +08:00
|
|
|
// GlobalConfig stores the configuration for dex preopting. The fields are set
|
2020-01-11 04:32:59 +08:00
|
|
|
// from product variables via dex_preopt_config.mk.
|
2018-11-13 02:13:39 +08:00
|
|
|
type GlobalConfig struct {
|
2021-01-16 02:40:04 +08:00
|
|
|
DisablePreopt bool // disable preopt for all modules (excluding boot images)
|
|
|
|
DisablePreoptBootImages bool // disable prepot for boot images
|
|
|
|
DisablePreoptModules []string // modules with preopt disabled by product-specific config
|
2018-11-13 02:13:39 +08:00
|
|
|
|
|
|
|
OnlyPreoptBootImageAndSystemServer bool // only preopt jars in the boot image or system server
|
|
|
|
|
2021-03-23 00:02:28 +08:00
|
|
|
PreoptWithUpdatableBcp bool // If updatable boot jars are included in dexpreopt or not.
|
|
|
|
|
2020-02-06 23:14:29 +08:00
|
|
|
UseArtImage bool // use the art image (use other boot class path dex files without image)
|
|
|
|
|
2018-11-13 02:13:39 +08:00
|
|
|
HasSystemOther bool // store odex files that match PatternsOnSystemOther on the system_other partition
|
|
|
|
PatternsOnSystemOther []string // patterns (using '%' to denote a prefix match) to put odex on the system_other partition
|
|
|
|
|
2019-02-16 02:39:37 +08:00
|
|
|
DisableGenerateProfile bool // don't generate profiles
|
|
|
|
ProfileDir string // directory to find profiles in
|
2018-11-13 02:13:39 +08:00
|
|
|
|
2020-07-01 21:31:13 +08:00
|
|
|
BootJars android.ConfiguredJarList // modules for jars that form the boot class path
|
|
|
|
UpdatableBootJars android.ConfiguredJarList // jars within apex that form the boot class path
|
2019-02-12 06:21:24 +08:00
|
|
|
|
2020-07-01 21:31:13 +08:00
|
|
|
ArtApexJars android.ConfiguredJarList // modules for jars that are in the ART APEX
|
2018-12-20 01:57:57 +08:00
|
|
|
|
2020-07-01 21:31:13 +08:00
|
|
|
SystemServerJars []string // jars that form the system server
|
|
|
|
SystemServerApps []string // apps that are loaded into system server
|
|
|
|
UpdatableSystemServerJars android.ConfiguredJarList // jars within apex that are loaded into system server
|
|
|
|
SpeedApps []string // apps that should be speed optimized
|
2018-11-13 02:13:39 +08:00
|
|
|
|
2020-03-27 19:30:00 +08:00
|
|
|
BrokenSuboptimalOrderOfSystemServerJars bool // if true, sub-optimal order does not cause a build error
|
|
|
|
|
2018-11-13 02:13:39 +08:00
|
|
|
PreoptFlags []string // global dex2oat flags that should be used if no module-specific dex2oat flags are specified
|
|
|
|
|
|
|
|
DefaultCompilerFilter string // default compiler filter to pass to dex2oat, overridden by --compiler-filter= in module-specific dex2oat flags
|
|
|
|
SystemServerCompilerFilter string // default compiler filter to pass to dex2oat for system server jars
|
|
|
|
|
2019-10-18 21:51:38 +08:00
|
|
|
GenerateDMFiles bool // generate Dex Metadata files
|
2018-11-13 02:13:39 +08:00
|
|
|
|
|
|
|
NoDebugInfo bool // don't generate debug info by default
|
2019-04-30 00:33:50 +08:00
|
|
|
DontResolveStartupStrings bool // don't resolve string literals loaded during application startup.
|
2018-11-13 02:13:39 +08:00
|
|
|
AlwaysSystemServerDebugInfo bool // always generate mini debug info for system server modules (overrides NoDebugInfo=true)
|
|
|
|
NeverSystemServerDebugInfo bool // never generate mini debug info for system server modules (overrides NoDebugInfo=false)
|
|
|
|
AlwaysOtherDebugInfo bool // always generate mini debug info for non-system server modules (overrides NoDebugInfo=true)
|
|
|
|
NeverOtherDebugInfo bool // never generate mini debug info for non-system server modules (overrides NoDebugInfo=true)
|
|
|
|
|
|
|
|
IsEng bool // build is a eng variant
|
|
|
|
SanitizeLite bool // build is the second phase of a SANITIZE_LITE build
|
|
|
|
|
|
|
|
DefaultAppImages bool // build app images (TODO: .art files?) by default
|
|
|
|
|
2019-02-12 06:21:24 +08:00
|
|
|
Dex2oatXmx string // max heap size for dex2oat
|
|
|
|
Dex2oatXms string // initial heap size for dex2oat
|
2018-11-13 02:13:39 +08:00
|
|
|
|
|
|
|
EmptyDirectory string // path to an empty directory
|
|
|
|
|
2019-02-12 07:11:14 +08:00
|
|
|
CpuVariant map[android.ArchType]string // cpu variant for each architecture
|
|
|
|
InstructionSetFeatures map[android.ArchType]string // instruction set for each architecture
|
2018-11-13 02:13:39 +08:00
|
|
|
|
2021-01-20 22:30:40 +08:00
|
|
|
BootImageProfiles android.Paths // path to a boot-image-profile.txt file
|
|
|
|
BootFlags string // extra flags to pass to dex2oat for the boot image
|
|
|
|
Dex2oatImageXmx string // max heap size for dex2oat for the boot image
|
|
|
|
Dex2oatImageXms string // initial heap size for dex2oat for the boot image
|
Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).
If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.
The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.
verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300
Test: Manually add some mismatch between the libraries in the Android.bp
and Android.mk files for dexpreopted apps, build with
RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
fail and they are compiled with compiler-filter "extract".
Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.
Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-18 00:23:28 +08:00
|
|
|
|
2021-03-02 20:25:02 +08:00
|
|
|
// If true, downgrade the compiler filter of dexpreopt to "verify" when verify_uses_libraries
|
Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).
If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.
The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.
verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300
Test: Manually add some mismatch between the libraries in the Android.bp
and Android.mk files for dexpreopted apps, build with
RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
fail and they are compiled with compiler-filter "extract".
Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.
Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-18 00:23:28 +08:00
|
|
|
// check fails, instead of failing the build. This will disable any AOT-compilation.
|
|
|
|
//
|
|
|
|
// The intended use case for this flag is to have a smoother migration path for the Java
|
|
|
|
// modules that need to add <uses-library> information in their build files. The flag allows to
|
|
|
|
// quickly silence build errors. This flag should be used with caution and only as a temporary
|
|
|
|
// measure, as it masks real errors and affects performance.
|
|
|
|
RelaxUsesLibraryCheck bool
|
2018-11-13 02:13:39 +08:00
|
|
|
}
|
|
|
|
|
2020-01-07 07:11:37 +08:00
|
|
|
// GlobalSoongConfig contains the global config that is generated from Soong,
|
|
|
|
// stored in dexpreopt_soong.config.
|
|
|
|
type GlobalSoongConfig struct {
|
|
|
|
// Paths to tools possibly used by the generated commands.
|
|
|
|
Profman android.Path
|
|
|
|
Dex2oat android.Path
|
|
|
|
Aapt android.Path
|
|
|
|
SoongZip android.Path
|
|
|
|
Zip2zip android.Path
|
|
|
|
ManifestCheck android.Path
|
2019-05-23 01:21:09 +08:00
|
|
|
ConstructContext android.Path
|
2018-11-13 02:13:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type ModuleConfig struct {
|
2019-01-30 05:00:33 +08:00
|
|
|
Name string
|
|
|
|
DexLocation string // dex location on device
|
2019-02-16 02:39:37 +08:00
|
|
|
BuildPath android.OutputPath
|
|
|
|
DexPath android.Path
|
2021-04-15 08:12:49 +08:00
|
|
|
ManifestPath android.OptionalPath
|
2019-01-30 05:00:33 +08:00
|
|
|
UncompressedDex bool
|
|
|
|
HasApkLibraries bool
|
|
|
|
PreoptFlags []string
|
2018-11-13 02:13:39 +08:00
|
|
|
|
2019-02-16 02:39:37 +08:00
|
|
|
ProfileClassListing android.OptionalPath
|
2018-11-13 02:13:39 +08:00
|
|
|
ProfileIsTextListing bool
|
2019-07-24 20:19:29 +08:00
|
|
|
ProfileBootListing android.OptionalPath
|
2018-11-13 02:13:39 +08:00
|
|
|
|
Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).
If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.
The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.
verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300
Test: Manually add some mismatch between the libraries in the Android.bp
and Android.mk files for dexpreopted apps, build with
RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
fail and they are compiled with compiler-filter "extract".
Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.
Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-18 00:23:28 +08:00
|
|
|
EnforceUsesLibraries bool // turn on build-time verify_uses_libraries check
|
|
|
|
EnforceUsesLibrariesStatusFile android.Path // a file with verify_uses_libraries errors (if any)
|
|
|
|
ProvidesUsesLibrary string // library name (usually the same as module name)
|
|
|
|
ClassLoaderContexts ClassLoaderContextMap
|
2018-11-13 02:13:39 +08:00
|
|
|
|
2019-11-08 18:54:21 +08:00
|
|
|
Archs []android.ArchType
|
|
|
|
DexPreoptImagesDeps []android.OutputPaths
|
|
|
|
DexPreoptImageLocations []string
|
2018-11-13 02:13:39 +08:00
|
|
|
|
2019-02-16 02:39:37 +08:00
|
|
|
PreoptBootClassPathDexFiles android.Paths // file paths of boot class path files
|
|
|
|
PreoptBootClassPathDexLocations []string // virtual locations of boot class path files
|
2019-02-12 06:21:24 +08:00
|
|
|
|
2018-11-13 02:13:39 +08:00
|
|
|
PreoptExtractedApk bool // Overrides OnlyPreoptModules
|
|
|
|
|
|
|
|
NoCreateAppImage bool
|
|
|
|
ForceCreateAppImage bool
|
|
|
|
|
|
|
|
PresignedPrebuilt bool
|
|
|
|
}
|
|
|
|
|
2020-01-07 07:11:37 +08:00
|
|
|
type globalSoongConfigSingleton struct{}
|
|
|
|
|
|
|
|
var pctx = android.NewPackageContext("android/soong/dexpreopt")
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
pctx.Import("android/soong/android")
|
|
|
|
android.RegisterSingletonType("dexpreopt-soong-config", func() android.Singleton {
|
|
|
|
return &globalSoongConfigSingleton{}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-02-16 02:39:37 +08:00
|
|
|
func constructPath(ctx android.PathContext, path string) android.Path {
|
|
|
|
buildDirPrefix := ctx.Config().BuildDir() + "/"
|
|
|
|
if path == "" {
|
|
|
|
return nil
|
|
|
|
} else if strings.HasPrefix(path, buildDirPrefix) {
|
|
|
|
return android.PathForOutput(ctx, strings.TrimPrefix(path, buildDirPrefix))
|
|
|
|
} else {
|
|
|
|
return android.PathForSource(ctx, path)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func constructPaths(ctx android.PathContext, paths []string) android.Paths {
|
|
|
|
var ret android.Paths
|
|
|
|
for _, path := range paths {
|
|
|
|
ret = append(ret, constructPath(ctx, path))
|
|
|
|
}
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func constructWritablePath(ctx android.PathContext, path string) android.WritablePath {
|
|
|
|
if path == "" {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return constructPath(ctx, path).(android.WritablePath)
|
|
|
|
}
|
|
|
|
|
2020-01-21 02:12:23 +08:00
|
|
|
// ParseGlobalConfig parses the given data assumed to be read from the global
|
|
|
|
// dexpreopt.config file into a GlobalConfig struct.
|
2020-02-01 01:44:54 +08:00
|
|
|
func ParseGlobalConfig(ctx android.PathContext, data []byte) (*GlobalConfig, error) {
|
2019-02-16 02:39:37 +08:00
|
|
|
type GlobalJSONConfig struct {
|
2020-02-01 01:44:54 +08:00
|
|
|
*GlobalConfig
|
2019-02-16 02:39:37 +08:00
|
|
|
|
|
|
|
// Copies of entries in GlobalConfig that are not constructable without extra parameters. They will be
|
|
|
|
// used to construct the real value manually below.
|
2020-10-24 04:14:20 +08:00
|
|
|
BootImageProfiles []string
|
2019-02-16 02:39:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
config := GlobalJSONConfig{}
|
2020-01-11 09:11:46 +08:00
|
|
|
err := json.Unmarshal(data, &config)
|
2019-02-16 02:39:37 +08:00
|
|
|
if err != nil {
|
2020-01-11 09:11:46 +08:00
|
|
|
return config.GlobalConfig, err
|
2019-02-16 02:39:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Construct paths that require a PathContext.
|
|
|
|
config.GlobalConfig.BootImageProfiles = constructPaths(ctx, config.BootImageProfiles)
|
|
|
|
|
2020-01-11 09:11:46 +08:00
|
|
|
return config.GlobalConfig, nil
|
2018-11-13 02:13:39 +08:00
|
|
|
}
|
|
|
|
|
2020-01-21 02:12:23 +08:00
|
|
|
type globalConfigAndRaw struct {
|
2020-02-01 01:44:54 +08:00
|
|
|
global *GlobalConfig
|
2020-01-21 02:12:23 +08:00
|
|
|
data []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetGlobalConfig returns the global dexpreopt.config that's created in the
|
|
|
|
// make config phase. It is loaded once the first time it is called for any
|
|
|
|
// ctx.Config(), and returns the same data for all future calls with the same
|
|
|
|
// ctx.Config(). A value can be inserted for tests using
|
|
|
|
// setDexpreoptTestGlobalConfig.
|
2020-02-01 01:44:54 +08:00
|
|
|
func GetGlobalConfig(ctx android.PathContext) *GlobalConfig {
|
2020-01-21 02:12:23 +08:00
|
|
|
return getGlobalConfigRaw(ctx).global
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetGlobalConfigRawData is the same as GetGlobalConfig, except that it returns
|
|
|
|
// the literal content of dexpreopt.config.
|
|
|
|
func GetGlobalConfigRawData(ctx android.PathContext) []byte {
|
|
|
|
return getGlobalConfigRaw(ctx).data
|
|
|
|
}
|
|
|
|
|
|
|
|
var globalConfigOnceKey = android.NewOnceKey("DexpreoptGlobalConfig")
|
|
|
|
var testGlobalConfigOnceKey = android.NewOnceKey("TestDexpreoptGlobalConfig")
|
|
|
|
|
|
|
|
func getGlobalConfigRaw(ctx android.PathContext) globalConfigAndRaw {
|
|
|
|
return ctx.Config().Once(globalConfigOnceKey, func() interface{} {
|
|
|
|
if data, err := ctx.Config().DexpreoptGlobalConfig(ctx); err != nil {
|
|
|
|
panic(err)
|
|
|
|
} else if data != nil {
|
|
|
|
globalConfig, err := ParseGlobalConfig(ctx, data)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return globalConfigAndRaw{globalConfig, data}
|
|
|
|
}
|
|
|
|
|
|
|
|
// No global config filename set, see if there is a test config set
|
|
|
|
return ctx.Config().Once(testGlobalConfigOnceKey, func() interface{} {
|
|
|
|
// Nope, return a config with preopting disabled
|
2020-02-01 01:44:54 +08:00
|
|
|
return globalConfigAndRaw{&GlobalConfig{
|
2021-01-16 02:40:04 +08:00
|
|
|
DisablePreopt: true,
|
|
|
|
DisablePreoptBootImages: true,
|
|
|
|
DisableGenerateProfile: true,
|
2020-01-21 02:12:23 +08:00
|
|
|
}, nil}
|
|
|
|
})
|
|
|
|
}).(globalConfigAndRaw)
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetTestGlobalConfig sets a GlobalConfig that future calls to GetGlobalConfig
|
|
|
|
// will return. It must be called before the first call to GetGlobalConfig for
|
|
|
|
// the config.
|
2020-02-01 01:44:54 +08:00
|
|
|
func SetTestGlobalConfig(config android.Config, globalConfig *GlobalConfig) {
|
2020-01-21 02:12:23 +08:00
|
|
|
config.Once(testGlobalConfigOnceKey, func() interface{} { return globalConfigAndRaw{globalConfig, nil} })
|
|
|
|
}
|
|
|
|
|
2021-04-07 23:00:19 +08:00
|
|
|
// This struct is required to convert ModuleConfig from/to JSON.
|
|
|
|
// The types of fields in ModuleConfig are not convertible,
|
|
|
|
// so moduleJSONConfig has those fields as a convertible type.
|
|
|
|
type moduleJSONConfig struct {
|
|
|
|
*ModuleConfig
|
|
|
|
|
|
|
|
BuildPath string
|
|
|
|
DexPath string
|
|
|
|
ManifestPath string
|
|
|
|
|
|
|
|
ProfileClassListing string
|
|
|
|
ProfileBootListing string
|
|
|
|
|
|
|
|
EnforceUsesLibrariesStatusFile string
|
|
|
|
ClassLoaderContexts jsonClassLoaderContextMap
|
|
|
|
|
|
|
|
DexPreoptImagesDeps [][]string
|
|
|
|
|
|
|
|
PreoptBootClassPathDexFiles []string
|
|
|
|
}
|
|
|
|
|
2020-01-21 02:12:23 +08:00
|
|
|
// ParseModuleConfig parses a per-module dexpreopt.config file into a
|
|
|
|
// ModuleConfig struct. It is not used in Soong, which receives a ModuleConfig
|
|
|
|
// struct directly from java/dexpreopt.go. It is used in dexpreopt_gen called
|
|
|
|
// from Make to read the module dexpreopt.config written in the Make config
|
|
|
|
// stage.
|
2020-02-01 01:44:54 +08:00
|
|
|
func ParseModuleConfig(ctx android.PathContext, data []byte) (*ModuleConfig, error) {
|
2021-04-07 23:00:19 +08:00
|
|
|
config := moduleJSONConfig{}
|
2019-02-16 02:39:37 +08:00
|
|
|
|
2020-01-11 09:11:46 +08:00
|
|
|
err := json.Unmarshal(data, &config)
|
2019-02-16 02:39:37 +08:00
|
|
|
if err != nil {
|
|
|
|
return config.ModuleConfig, err
|
|
|
|
}
|
|
|
|
|
|
|
|
// Construct paths that require a PathContext.
|
|
|
|
config.ModuleConfig.BuildPath = constructPath(ctx, config.BuildPath).(android.OutputPath)
|
|
|
|
config.ModuleConfig.DexPath = constructPath(ctx, config.DexPath)
|
2021-04-15 08:12:49 +08:00
|
|
|
config.ModuleConfig.ManifestPath = android.OptionalPathForPath(constructPath(ctx, config.ManifestPath))
|
2019-02-16 02:39:37 +08:00
|
|
|
config.ModuleConfig.ProfileClassListing = android.OptionalPathForPath(constructPath(ctx, config.ProfileClassListing))
|
Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).
If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.
The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.
verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300
Test: Manually add some mismatch between the libraries in the Android.bp
and Android.mk files for dexpreopted apps, build with
RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
fail and they are compiled with compiler-filter "extract".
Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.
Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-18 00:23:28 +08:00
|
|
|
config.ModuleConfig.EnforceUsesLibrariesStatusFile = constructPath(ctx, config.EnforceUsesLibrariesStatusFile)
|
2020-11-03 23:15:46 +08:00
|
|
|
config.ModuleConfig.ClassLoaderContexts = fromJsonClassLoaderContext(ctx, config.ClassLoaderContexts)
|
2019-02-16 02:39:37 +08:00
|
|
|
config.ModuleConfig.PreoptBootClassPathDexFiles = constructPaths(ctx, config.PreoptBootClassPathDexFiles)
|
|
|
|
|
2019-06-14 05:44:53 +08:00
|
|
|
// This needs to exist, but dependencies are already handled in Make, so we don't need to pass them through JSON.
|
2021-04-26 21:57:27 +08:00
|
|
|
config.ModuleConfig.DexPreoptImagesDeps = make([]android.OutputPaths, len(config.ModuleConfig.Archs))
|
2019-06-14 05:44:53 +08:00
|
|
|
|
2019-02-16 02:39:37 +08:00
|
|
|
return config.ModuleConfig, nil
|
2018-11-13 02:13:39 +08:00
|
|
|
}
|
|
|
|
|
2021-04-07 23:00:19 +08:00
|
|
|
func pathsListToStringLists(pathsList []android.OutputPaths) [][]string {
|
|
|
|
ret := make([][]string, 0, len(pathsList))
|
|
|
|
for _, paths := range pathsList {
|
|
|
|
ret = append(ret, paths.Strings())
|
2021-01-15 01:52:43 +08:00
|
|
|
}
|
2021-04-07 23:00:19 +08:00
|
|
|
return ret
|
|
|
|
}
|
2021-01-15 01:52:43 +08:00
|
|
|
|
2021-04-07 23:00:19 +08:00
|
|
|
func moduleConfigToJSON(config *ModuleConfig) ([]byte, error) {
|
|
|
|
return json.MarshalIndent(&moduleJSONConfig{
|
|
|
|
BuildPath: config.BuildPath.String(),
|
|
|
|
DexPath: config.DexPath.String(),
|
|
|
|
ManifestPath: config.ManifestPath.String(),
|
|
|
|
ProfileClassListing: config.ProfileClassListing.String(),
|
|
|
|
ProfileBootListing: config.ProfileBootListing.String(),
|
|
|
|
EnforceUsesLibrariesStatusFile: config.EnforceUsesLibrariesStatusFile.String(),
|
|
|
|
ClassLoaderContexts: toJsonClassLoaderContext(config.ClassLoaderContexts),
|
|
|
|
DexPreoptImagesDeps: pathsListToStringLists(config.DexPreoptImagesDeps),
|
|
|
|
PreoptBootClassPathDexFiles: config.PreoptBootClassPathDexFiles.Strings(),
|
|
|
|
ModuleConfig: config,
|
|
|
|
}, "", " ")
|
|
|
|
}
|
2021-01-15 01:52:43 +08:00
|
|
|
|
2021-04-07 23:00:19 +08:00
|
|
|
// WriteModuleConfig serializes a ModuleConfig into a per-module dexpreopt.config JSON file.
|
|
|
|
// These config files are used for post-processing.
|
|
|
|
func WriteModuleConfig(ctx android.ModuleContext, config *ModuleConfig, path android.WritablePath) {
|
|
|
|
if path == nil {
|
|
|
|
return
|
2021-01-15 01:52:43 +08:00
|
|
|
}
|
|
|
|
|
2021-04-07 23:00:19 +08:00
|
|
|
data, err := moduleConfigToJSON(config)
|
2021-01-15 01:52:43 +08:00
|
|
|
if err != nil {
|
|
|
|
ctx.ModuleErrorf("failed to JSON marshal module dexpreopt.config: %v", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
android.WriteFileRule(ctx, path, string(data))
|
|
|
|
}
|
|
|
|
|
2020-01-11 08:37:30 +08:00
|
|
|
// dex2oatModuleName returns the name of the module to use for the dex2oat host
|
|
|
|
// tool. It should be a binary module with public visibility that is compiled
|
|
|
|
// and installed for host.
|
|
|
|
func dex2oatModuleName(config android.Config) string {
|
|
|
|
// Default to the debug variant of dex2oat to help find bugs.
|
|
|
|
// Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
|
|
|
|
if config.Getenv("USE_DEX2OAT_DEBUG") == "false" {
|
|
|
|
return "dex2oat"
|
|
|
|
} else {
|
|
|
|
return "dex2oatd"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-24 22:34:40 +08:00
|
|
|
type dex2oatDependencyTag struct {
|
2020-01-11 08:37:30 +08:00
|
|
|
blueprint.BaseDependencyTag
|
2021-03-24 22:34:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (d dex2oatDependencyTag) ExcludeFromVisibilityEnforcement() {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d dex2oatDependencyTag) ExcludeFromApexContents() {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Dex2oatDepTag represents the dependency onto the dex2oatd module. It is added to any module that
|
|
|
|
// needs dexpreopting and so it makes no sense for it to be checked for visibility or included in
|
|
|
|
// the apex.
|
|
|
|
var Dex2oatDepTag = dex2oatDependencyTag{}
|
|
|
|
|
|
|
|
var _ android.ExcludeFromVisibilityEnforcementTag = Dex2oatDepTag
|
|
|
|
var _ android.ExcludeFromApexContentsTag = Dex2oatDepTag
|
2020-01-11 08:37:30 +08:00
|
|
|
|
2020-02-01 01:10:36 +08:00
|
|
|
// RegisterToolDeps adds the necessary dependencies to binary modules for tools
|
|
|
|
// that are required later when Get(Cached)GlobalSoongConfig is called. It
|
|
|
|
// should be called from a mutator that's registered with
|
|
|
|
// android.RegistrationContext.FinalDepsMutators.
|
|
|
|
func RegisterToolDeps(ctx android.BottomUpMutatorContext) {
|
2020-01-11 08:37:30 +08:00
|
|
|
dex2oatBin := dex2oatModuleName(ctx.Config())
|
|
|
|
v := ctx.Config().BuildOSTarget.Variations()
|
2021-01-16 02:40:04 +08:00
|
|
|
ctx.AddFarVariationDependencies(v, Dex2oatDepTag, dex2oatBin)
|
2020-01-11 08:37:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func dex2oatPathFromDep(ctx android.ModuleContext) android.Path {
|
|
|
|
dex2oatBin := dex2oatModuleName(ctx.Config())
|
|
|
|
|
2020-08-19 00:37:41 +08:00
|
|
|
// Find the right dex2oat module, trying to follow PrebuiltDepTag from source
|
|
|
|
// to prebuilt if there is one. We wouldn't have to do this if the
|
|
|
|
// prebuilt_postdeps mutator that replaces source deps with prebuilt deps was
|
|
|
|
// run after RegisterToolDeps above, but changing that leads to ordering
|
|
|
|
// problems between mutators (RegisterToolDeps needs to run late to act on
|
|
|
|
// final variants, while prebuilt_postdeps needs to run before many of the
|
|
|
|
// PostDeps mutators, like the APEX mutators). Hence we need to dig out the
|
|
|
|
// prebuilt explicitly here instead.
|
|
|
|
var dex2oatModule android.Module
|
|
|
|
ctx.WalkDeps(func(child, parent android.Module) bool {
|
2021-01-16 02:40:04 +08:00
|
|
|
if parent == ctx.Module() && ctx.OtherModuleDependencyTag(child) == Dex2oatDepTag {
|
2020-08-19 00:37:41 +08:00
|
|
|
// Found the source module, or prebuilt module that has replaced the source.
|
|
|
|
dex2oatModule = child
|
|
|
|
if p, ok := child.(android.PrebuiltInterface); ok && p.Prebuilt() != nil {
|
|
|
|
return false // If it's the prebuilt we're done.
|
|
|
|
} else {
|
|
|
|
return true // Recurse to check if the source has a prebuilt dependency.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if parent == dex2oatModule && ctx.OtherModuleDependencyTag(child) == android.PrebuiltDepTag {
|
|
|
|
if p, ok := child.(android.PrebuiltInterface); ok && p.Prebuilt() != nil && p.Prebuilt().UsePrebuilt() {
|
|
|
|
dex2oatModule = child // Found a prebuilt that should be used.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
})
|
|
|
|
|
2020-01-11 08:37:30 +08:00
|
|
|
if dex2oatModule == nil {
|
|
|
|
// If this happens there's probably a missing call to AddToolDeps in DepsMutator.
|
|
|
|
panic(fmt.Sprintf("Failed to lookup %s dependency", dex2oatBin))
|
|
|
|
}
|
|
|
|
|
|
|
|
dex2oatPath := dex2oatModule.(android.HostToolProvider).HostToolPath()
|
|
|
|
if !dex2oatPath.Valid() {
|
|
|
|
panic(fmt.Sprintf("Failed to find host tool path in %s", dex2oatModule))
|
|
|
|
}
|
|
|
|
|
|
|
|
return dex2oatPath.Path()
|
|
|
|
}
|
|
|
|
|
2020-01-11 04:32:59 +08:00
|
|
|
// createGlobalSoongConfig creates a GlobalSoongConfig from the current context.
|
2020-01-07 07:11:37 +08:00
|
|
|
// Should not be used in dexpreopt_gen.
|
2020-02-01 01:44:54 +08:00
|
|
|
func createGlobalSoongConfig(ctx android.ModuleContext) *GlobalSoongConfig {
|
|
|
|
return &GlobalSoongConfig{
|
2020-01-07 07:11:37 +08:00
|
|
|
Profman: ctx.Config().HostToolPath(ctx, "profman"),
|
2020-01-11 08:37:30 +08:00
|
|
|
Dex2oat: dex2oatPathFromDep(ctx),
|
2020-01-07 07:11:37 +08:00
|
|
|
Aapt: ctx.Config().HostToolPath(ctx, "aapt"),
|
|
|
|
SoongZip: ctx.Config().HostToolPath(ctx, "soong_zip"),
|
|
|
|
Zip2zip: ctx.Config().HostToolPath(ctx, "zip2zip"),
|
|
|
|
ManifestCheck: ctx.Config().HostToolPath(ctx, "manifest_check"),
|
2020-06-30 19:39:01 +08:00
|
|
|
ConstructContext: ctx.Config().HostToolPath(ctx, "construct_context"),
|
2020-01-07 07:11:37 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-11 08:37:30 +08:00
|
|
|
// The main reason for this Once cache for GlobalSoongConfig is to make the
|
|
|
|
// dex2oat path available to singletons. In ordinary modules we get it through a
|
2021-01-16 02:40:04 +08:00
|
|
|
// Dex2oatDepTag dependency, but in singletons there's no simple way to do the
|
2020-01-11 08:37:30 +08:00
|
|
|
// same thing and ensure the right variant is selected, hence this cache to make
|
|
|
|
// the resolved path available to singletons. This means we depend on there
|
2021-01-16 02:40:04 +08:00
|
|
|
// being at least one ordinary module with a Dex2oatDepTag dependency.
|
2020-01-11 08:37:30 +08:00
|
|
|
//
|
|
|
|
// TODO(b/147613152): Implement a way to deal with dependencies from singletons,
|
2021-01-21 23:05:11 +08:00
|
|
|
// and then possibly remove this cache altogether.
|
2020-01-11 04:32:59 +08:00
|
|
|
var globalSoongConfigOnceKey = android.NewOnceKey("DexpreoptGlobalSoongConfig")
|
|
|
|
|
|
|
|
// GetGlobalSoongConfig creates a GlobalSoongConfig the first time it's called,
|
|
|
|
// and later returns the same cached instance.
|
2020-02-01 01:44:54 +08:00
|
|
|
func GetGlobalSoongConfig(ctx android.ModuleContext) *GlobalSoongConfig {
|
2020-01-11 04:32:59 +08:00
|
|
|
globalSoong := ctx.Config().Once(globalSoongConfigOnceKey, func() interface{} {
|
|
|
|
return createGlobalSoongConfig(ctx)
|
2020-02-01 01:44:54 +08:00
|
|
|
}).(*GlobalSoongConfig)
|
2020-01-11 08:37:30 +08:00
|
|
|
|
|
|
|
// Always resolve the tool path from the dependency, to ensure that every
|
|
|
|
// module has the dependency added properly.
|
|
|
|
myDex2oat := dex2oatPathFromDep(ctx)
|
|
|
|
if myDex2oat != globalSoong.Dex2oat {
|
|
|
|
panic(fmt.Sprintf("Inconsistent dex2oat path in cached config: expected %s, got %s", globalSoong.Dex2oat, myDex2oat))
|
|
|
|
}
|
|
|
|
|
2020-01-11 04:32:59 +08:00
|
|
|
return globalSoong
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetCachedGlobalSoongConfig returns a cached GlobalSoongConfig created by an
|
|
|
|
// earlier GetGlobalSoongConfig call. This function works with any context
|
|
|
|
// compatible with a basic PathContext, since it doesn't try to create a
|
2020-02-01 01:10:36 +08:00
|
|
|
// GlobalSoongConfig with the proper paths (which requires a full
|
|
|
|
// ModuleContext). If there has been no prior call to GetGlobalSoongConfig, nil
|
|
|
|
// is returned.
|
2020-02-01 01:44:54 +08:00
|
|
|
func GetCachedGlobalSoongConfig(ctx android.PathContext) *GlobalSoongConfig {
|
2020-02-01 01:10:36 +08:00
|
|
|
return ctx.Config().Once(globalSoongConfigOnceKey, func() interface{} {
|
|
|
|
return (*GlobalSoongConfig)(nil)
|
|
|
|
}).(*GlobalSoongConfig)
|
2020-01-11 04:32:59 +08:00
|
|
|
}
|
|
|
|
|
2020-01-07 07:11:37 +08:00
|
|
|
type globalJsonSoongConfig struct {
|
|
|
|
Profman string
|
|
|
|
Dex2oat string
|
|
|
|
Aapt string
|
|
|
|
SoongZip string
|
|
|
|
Zip2zip string
|
|
|
|
ManifestCheck string
|
|
|
|
ConstructContext string
|
|
|
|
}
|
|
|
|
|
2020-01-21 02:12:23 +08:00
|
|
|
// ParseGlobalSoongConfig parses the given data assumed to be read from the
|
|
|
|
// global dexpreopt_soong.config file into a GlobalSoongConfig struct. It is
|
|
|
|
// only used in dexpreopt_gen.
|
2020-02-01 01:44:54 +08:00
|
|
|
func ParseGlobalSoongConfig(ctx android.PathContext, data []byte) (*GlobalSoongConfig, error) {
|
2020-01-07 07:11:37 +08:00
|
|
|
var jc globalJsonSoongConfig
|
|
|
|
|
2020-01-11 09:11:46 +08:00
|
|
|
err := json.Unmarshal(data, &jc)
|
2020-01-07 07:11:37 +08:00
|
|
|
if err != nil {
|
2020-02-01 01:44:54 +08:00
|
|
|
return &GlobalSoongConfig{}, err
|
2020-01-07 07:11:37 +08:00
|
|
|
}
|
|
|
|
|
2020-02-01 01:44:54 +08:00
|
|
|
config := &GlobalSoongConfig{
|
2020-01-07 07:11:37 +08:00
|
|
|
Profman: constructPath(ctx, jc.Profman),
|
|
|
|
Dex2oat: constructPath(ctx, jc.Dex2oat),
|
|
|
|
Aapt: constructPath(ctx, jc.Aapt),
|
|
|
|
SoongZip: constructPath(ctx, jc.SoongZip),
|
|
|
|
Zip2zip: constructPath(ctx, jc.Zip2zip),
|
|
|
|
ManifestCheck: constructPath(ctx, jc.ManifestCheck),
|
|
|
|
ConstructContext: constructPath(ctx, jc.ConstructContext),
|
|
|
|
}
|
|
|
|
|
|
|
|
return config, nil
|
|
|
|
}
|
|
|
|
|
2021-04-23 18:39:41 +08:00
|
|
|
// checkBootJarsConfigConsistency checks the consistency of BootJars and UpdatableBootJars fields in
|
|
|
|
// DexpreoptGlobalConfig and Config.productVariables.
|
|
|
|
func checkBootJarsConfigConsistency(ctx android.SingletonContext, dexpreoptConfig *GlobalConfig, config android.Config) {
|
|
|
|
compareBootJars := func(property string, dexpreoptJars, variableJars android.ConfiguredJarList) {
|
|
|
|
dexpreoptPairs := dexpreoptJars.CopyOfApexJarPairs()
|
|
|
|
variablePairs := variableJars.CopyOfApexJarPairs()
|
|
|
|
if !reflect.DeepEqual(dexpreoptPairs, variablePairs) {
|
|
|
|
ctx.Errorf("Inconsistent configuration of %[1]s\n"+
|
|
|
|
" dexpreopt.GlobalConfig.%[1]s = %[2]s\n"+
|
|
|
|
" productVariables.%[1]s = %[3]s",
|
|
|
|
property, dexpreoptPairs, variablePairs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
compareBootJars("BootJars", dexpreoptConfig.BootJars, config.NonUpdatableBootJars())
|
|
|
|
compareBootJars("UpdatableBootJars", dexpreoptConfig.UpdatableBootJars, config.UpdatableBootJars())
|
|
|
|
}
|
|
|
|
|
2020-01-07 07:11:37 +08:00
|
|
|
func (s *globalSoongConfigSingleton) GenerateBuildActions(ctx android.SingletonContext) {
|
2021-04-23 18:39:41 +08:00
|
|
|
checkBootJarsConfigConsistency(ctx, GetGlobalConfig(ctx), ctx.Config())
|
|
|
|
|
2020-01-11 08:37:30 +08:00
|
|
|
if GetGlobalConfig(ctx).DisablePreopt {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-01-11 04:32:59 +08:00
|
|
|
config := GetCachedGlobalSoongConfig(ctx)
|
2020-02-01 01:10:36 +08:00
|
|
|
if config == nil {
|
|
|
|
// No module has enabled dexpreopting, so we assume there will be no calls
|
|
|
|
// to dexpreopt_gen.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-01-07 07:11:37 +08:00
|
|
|
jc := globalJsonSoongConfig{
|
|
|
|
Profman: config.Profman.String(),
|
|
|
|
Dex2oat: config.Dex2oat.String(),
|
|
|
|
Aapt: config.Aapt.String(),
|
|
|
|
SoongZip: config.SoongZip.String(),
|
|
|
|
Zip2zip: config.Zip2zip.String(),
|
|
|
|
ManifestCheck: config.ManifestCheck.String(),
|
|
|
|
ConstructContext: config.ConstructContext.String(),
|
|
|
|
}
|
|
|
|
|
|
|
|
data, err := json.Marshal(jc)
|
|
|
|
if err != nil {
|
|
|
|
ctx.Errorf("failed to JSON marshal GlobalSoongConfig: %v", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-11-14 03:48:42 +08:00
|
|
|
android.WriteFileRule(ctx, android.PathForOutput(ctx, "dexpreopt_soong.config"), string(data))
|
2020-01-07 07:11:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *globalSoongConfigSingleton) MakeVars(ctx android.MakeVarsContext) {
|
2020-01-11 08:37:30 +08:00
|
|
|
if GetGlobalConfig(ctx).DisablePreopt {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-01-11 04:32:59 +08:00
|
|
|
config := GetCachedGlobalSoongConfig(ctx)
|
2020-02-01 01:10:36 +08:00
|
|
|
if config == nil {
|
|
|
|
return
|
|
|
|
}
|
2020-01-07 07:11:37 +08:00
|
|
|
|
|
|
|
ctx.Strict("DEX2OAT", config.Dex2oat.String())
|
|
|
|
ctx.Strict("DEXPREOPT_GEN_DEPS", strings.Join([]string{
|
|
|
|
config.Profman.String(),
|
|
|
|
config.Dex2oat.String(),
|
|
|
|
config.Aapt.String(),
|
|
|
|
config.SoongZip.String(),
|
|
|
|
config.Zip2zip.String(),
|
|
|
|
config.ManifestCheck.String(),
|
|
|
|
config.ConstructContext.String(),
|
|
|
|
}, " "))
|
|
|
|
}
|
|
|
|
|
2020-02-01 01:44:54 +08:00
|
|
|
func GlobalConfigForTests(ctx android.PathContext) *GlobalConfig {
|
|
|
|
return &GlobalConfig{
|
2019-02-16 02:39:37 +08:00
|
|
|
DisablePreopt: false,
|
|
|
|
DisablePreoptModules: nil,
|
|
|
|
OnlyPreoptBootImageAndSystemServer: false,
|
|
|
|
HasSystemOther: false,
|
|
|
|
PatternsOnSystemOther: nil,
|
|
|
|
DisableGenerateProfile: false,
|
|
|
|
ProfileDir: "",
|
2020-07-01 21:31:13 +08:00
|
|
|
BootJars: android.EmptyConfiguredJarList(),
|
|
|
|
UpdatableBootJars: android.EmptyConfiguredJarList(),
|
|
|
|
ArtApexJars: android.EmptyConfiguredJarList(),
|
2019-02-16 02:39:37 +08:00
|
|
|
SystemServerJars: nil,
|
|
|
|
SystemServerApps: nil,
|
2020-07-01 21:31:13 +08:00
|
|
|
UpdatableSystemServerJars: android.EmptyConfiguredJarList(),
|
2019-02-16 02:39:37 +08:00
|
|
|
SpeedApps: nil,
|
|
|
|
PreoptFlags: nil,
|
|
|
|
DefaultCompilerFilter: "",
|
|
|
|
SystemServerCompilerFilter: "",
|
|
|
|
GenerateDMFiles: false,
|
|
|
|
NoDebugInfo: false,
|
2019-04-30 00:33:50 +08:00
|
|
|
DontResolveStartupStrings: false,
|
2019-02-16 02:39:37 +08:00
|
|
|
AlwaysSystemServerDebugInfo: false,
|
|
|
|
NeverSystemServerDebugInfo: false,
|
|
|
|
AlwaysOtherDebugInfo: false,
|
|
|
|
NeverOtherDebugInfo: false,
|
|
|
|
IsEng: false,
|
|
|
|
SanitizeLite: false,
|
|
|
|
DefaultAppImages: false,
|
|
|
|
Dex2oatXmx: "",
|
|
|
|
Dex2oatXms: "",
|
|
|
|
EmptyDirectory: "empty_dir",
|
|
|
|
CpuVariant: nil,
|
|
|
|
InstructionSetFeatures: nil,
|
|
|
|
BootImageProfiles: nil,
|
|
|
|
BootFlags: "",
|
|
|
|
Dex2oatImageXmx: "",
|
|
|
|
Dex2oatImageXms: "",
|
2020-01-11 04:32:59 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-21 23:05:11 +08:00
|
|
|
func globalSoongConfigForTests() *GlobalSoongConfig {
|
|
|
|
return &GlobalSoongConfig{
|
|
|
|
Profman: android.PathForTesting("profman"),
|
|
|
|
Dex2oat: android.PathForTesting("dex2oat"),
|
|
|
|
Aapt: android.PathForTesting("aapt"),
|
|
|
|
SoongZip: android.PathForTesting("soong_zip"),
|
|
|
|
Zip2zip: android.PathForTesting("zip2zip"),
|
|
|
|
ManifestCheck: android.PathForTesting("manifest_check"),
|
|
|
|
ConstructContext: android.PathForTesting("construct_context"),
|
|
|
|
}
|
2019-02-16 02:39:37 +08:00
|
|
|
}
|