diff options
Diffstat (limited to 'android/config.go')
-rw-r--r-- | android/config.go | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/android/config.go b/android/config.go index 250c312b7..47346fcf1 100644 --- a/android/config.go +++ b/android/config.go @@ -170,6 +170,10 @@ type config struct { ninjaFileDepsSet sync.Map OncePer + + mixedBuildsLock sync.Mutex + mixedBuildEnabledModules map[string]struct{} + mixedBuildDisabledModules map[string]struct{} } type deviceConfig struct { @@ -375,7 +379,9 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string // passed to PathForSource or PathForModuleSrc. TestAllowNonExistentPaths: true, - BazelContext: noopBazelContext{}, + BazelContext: noopBazelContext{}, + mixedBuildDisabledModules: make(map[string]struct{}), + mixedBuildEnabledModules: make(map[string]struct{}), } config.deviceConfig = &deviceConfig{ config: config, @@ -410,7 +416,7 @@ func modifyTestConfigToSupportArchMutator(testConfig Config) { config.BuildOSTarget = config.Targets[config.BuildOS][0] config.BuildOSCommonTarget = getCommonTargets(config.Targets[config.BuildOS])[0] config.AndroidCommonTarget = getCommonTargets(config.Targets[Android])[0] - config.AndroidFirstDeviceTarget = firstTarget(config.Targets[Android], "lib64", "lib32")[0] + config.AndroidFirstDeviceTarget = FirstTarget(config.Targets[Android], "lib64", "lib32")[0] config.TestProductVariables.DeviceArch = proptools.StringPtr("arm64") config.TestProductVariables.DeviceArchVariant = proptools.StringPtr("armv8-a") config.TestProductVariables.DeviceSecondaryArch = proptools.StringPtr("arm") @@ -466,8 +472,10 @@ func NewConfig(moduleListFile string, runGoTests bool, outDir, soongOutDir strin runGoTests: runGoTests, multilibConflicts: make(map[ArchType]bool), - moduleListFile: moduleListFile, - fs: pathtools.NewOsFs(absSrcDir), + moduleListFile: moduleListFile, + fs: pathtools.NewOsFs(absSrcDir), + mixedBuildDisabledModules: make(map[string]struct{}), + mixedBuildEnabledModules: make(map[string]struct{}), } config.deviceConfig = &deviceConfig{ @@ -546,11 +554,11 @@ func NewConfig(moduleListFile string, runGoTests bool, outDir, soongOutDir strin // Compilation targets for Android. if len(config.Targets[Android]) > 0 { config.AndroidCommonTarget = getCommonTargets(config.Targets[Android])[0] - config.AndroidFirstDeviceTarget = firstTarget(config.Targets[Android], "lib64", "lib32")[0] + config.AndroidFirstDeviceTarget = FirstTarget(config.Targets[Android], "lib64", "lib32")[0] } config.BazelContext, err = NewBazelContext(config) - config.bp2buildPackageConfig = bp2buildAllowlist + config.bp2buildPackageConfig = getBp2BuildAllowList() return Config{config}, err } @@ -690,6 +698,10 @@ func (c *config) IsEnvFalse(key string) bool { return value == "0" || value == "n" || value == "no" || value == "off" || value == "false" } +func (c *config) TargetsJava17() bool { + return c.IsEnvTrue("EXPERIMENTAL_TARGET_JAVA_VERSION_17") +} + // EnvDeps returns the environment variables this build depends on. The first // call to this function blocks future reads from the environment. func (c *config) EnvDeps() map[string]string { @@ -781,6 +793,10 @@ func (c *config) PlatformVersionLastStable() string { return String(c.productVariables.Platform_version_last_stable) } +func (c *config) PlatformVersionKnownCodenames() string { + return String(c.productVariables.Platform_version_known_codenames) +} + func (c *config) MinSupportedSdkVersion() ApiLevel { return uncheckedFinalApiLevel(19) } @@ -1486,6 +1502,10 @@ func (c *config) MissingUsesLibraries() []string { return c.productVariables.MissingUsesLibraries } +func (c *config) TargetMultitreeUpdateMeta() bool { + return c.productVariables.MultitreeUpdateMeta +} + func (c *deviceConfig) DeviceArch() string { return String(c.config.productVariables.DeviceArch) } @@ -1677,6 +1697,10 @@ func (c *deviceConfig) BuildBrokenInputDir(name string) bool { return InList(name, c.config.productVariables.BuildBrokenInputDirModules) } +func (c *deviceConfig) BuildBrokenDepfile() bool { + return Bool(c.config.productVariables.BuildBrokenDepfile) +} + func (c *deviceConfig) RequiresInsecureExecmemForSwiftshader() bool { return c.config.productVariables.RequiresInsecureExecmemForSwiftshader } @@ -2034,3 +2058,14 @@ func (c *config) RBEWrapper() string { func (c *config) UseHostMusl() bool { return Bool(c.productVariables.HostMusl) } + +func (c *config) LogMixedBuild(ctx BaseModuleContext, useBazel bool) { + moduleName := ctx.Module().Name() + c.mixedBuildsLock.Lock() + defer c.mixedBuildsLock.Unlock() + if useBazel { + c.mixedBuildEnabledModules[moduleName] = struct{}{} + } else { + c.mixedBuildDisabledModules[moduleName] = struct{}{} + } +} |