Replace ModuleContext.AConfig() with Config()
AConfig() now duplicates Config(). Replace the uses of AConfig()
with Config(). Leave AConfig() for now until code in other
projects is cleaned up.
Test: m checkbuild
Change-Id: Ic88be643049d21dba45dbd1a65588ed94bf43bdc
diff --git a/android/arch.go b/android/arch.go
index 5ea9759..7f9abc6 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -305,7 +305,7 @@
primaryModules := make(map[int]bool)
for _, class := range osClasses {
- targets := mctx.AConfig().Targets[class]
+ targets := mctx.Config().Targets[class]
if len(targets) == 0 {
continue
}
@@ -325,7 +325,7 @@
var prefer32 bool
switch class {
case Device:
- prefer32 = mctx.AConfig().DevicePrefer32BitExecutables()
+ prefer32 = mctx.Config().DevicePrefer32BitExecutables()
case HostCross:
// Windows builds always prefer 32-bit
prefer32 = true
@@ -774,7 +774,7 @@
// that are being compiled for 64-bit. Its expected use case is binaries like linker and
// debuggerd that need to know when they are a 32-bit process running on a 64-bit device
if os.Class == Device {
- if ctx.AConfig().Android64() {
+ if ctx.Config().Android64() {
field := "Android64"
prefix := "target.android64"
a.appendProperties(ctx, genProps, targetProp, field, prefix)
@@ -785,13 +785,13 @@
}
if arch.ArchType == X86 && (hasArmAbi(arch) ||
- hasArmAndroidArch(ctx.AConfig().Targets[Device])) {
+ hasArmAndroidArch(ctx.Config().Targets[Device])) {
field := "Arm_on_x86"
prefix := "target.arm_on_x86"
a.appendProperties(ctx, genProps, targetProp, field, prefix)
}
if arch.ArchType == X86_64 && (hasArmAbi(arch) ||
- hasArmAndroidArch(ctx.AConfig().Targets[Device])) {
+ hasArmAndroidArch(ctx.Config().Targets[Device])) {
field := "Arm_on_x86_64"
prefix := "target.arm_on_x86_64"
a.appendProperties(ctx, genProps, targetProp, field, prefix)
diff --git a/android/hooks.go b/android/hooks.go
index a9bfd33..57560d2 100644
--- a/android/hooks.go
+++ b/android/hooks.go
@@ -26,7 +26,7 @@
// before the module has been split into architecture variants, and before defaults modules have
// been applied.
type LoadHookContext interface {
- // TODO: a new context that includes AConfig() but not Target(), etc.?
+ // TODO: a new context that includes Config() but not Target(), etc.?
BaseContext
AppendProperties(...interface{})
PrependProperties(...interface{})
diff --git a/android/module.go b/android/module.go
index 476929a..c728487 100644
--- a/android/module.go
+++ b/android/module.go
@@ -720,7 +720,7 @@
}
if !aModule.Enabled() {
- if a.AConfig().AllowMissingDependencies() {
+ if a.Config().AllowMissingDependencies() {
a.AddMissingDependencies([]string{a.OtherModuleName(aModule)})
} else {
a.ModuleErrorf("depends on disabled module %q", a.OtherModuleName(aModule))
@@ -878,11 +878,11 @@
}
if a.Device() {
- if a.AConfig().SkipDeviceInstall() {
+ if a.Config().SkipDeviceInstall() {
return true
}
- if a.AConfig().SkipMegaDeviceInstall(fullInstallPath.String()) {
+ if a.Config().SkipMegaDeviceInstall(fullInstallPath.String()) {
return true
}
}
@@ -927,7 +927,7 @@
Input: srcPath,
Implicits: implicitDeps,
OrderOnly: orderOnlyDeps,
- Default: !a.AConfig().EmbeddedInMake(),
+ Default: !a.Config().EmbeddedInMake(),
})
a.installFiles = append(a.installFiles, fullInstallPath)
@@ -947,7 +947,7 @@
Description: "install symlink " + fullInstallPath.Base(),
Output: fullInstallPath,
OrderOnly: Paths{srcPath},
- Default: !a.AConfig().EmbeddedInMake(),
+ Default: !a.Config().EmbeddedInMake(),
Args: map[string]string{
"fromPath": srcPath.String(),
},
diff --git a/android/paths.go b/android/paths.go
index cdc0399..e0cbd21 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -238,7 +238,7 @@
// source directory, but strip the local source directory from the beginning of
// each string.
func pathsForModuleSrcFromFullPath(ctx ModuleContext, paths []string) Paths {
- prefix := filepath.Join(ctx.AConfig().srcDir, ctx.ModuleDir()) + "/"
+ prefix := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir()) + "/"
if prefix == "./" {
prefix = ""
}
@@ -262,7 +262,7 @@
}
// Use Glob so that if the default doesn't exist, a dependency is added so that when it
// is created, we're run again.
- path := filepath.Join(ctx.AConfig().srcDir, ctx.ModuleDir(), def)
+ path := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir(), def)
return ctx.Glob(path, []string{})
}
@@ -844,7 +844,7 @@
if ctx.InstallInSanitizerDir() {
partition = "data/asan/" + partition
}
- outPaths = []string{"target", "product", ctx.AConfig().DeviceName(), partition}
+ outPaths = []string{"target", "product", ctx.Config().DeviceName(), partition}
} else {
switch ctx.Os() {
case Linux: