Rename ApexName to ApexVariationName
In preparation for reusing the same variation for multiple apexes,
rename ApexName to ApexVariationName.
Bug: 164216768
Test: all soong tests
Change-Id: I88f2c5b192ffa27acd38e01952d0cefd413222a0
diff --git a/cc/binary.go b/cc/binary.go
index 63bbd83..6769fa7 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -445,7 +445,7 @@
// The original path becomes a symlink to the corresponding file in the
// runtime APEX.
translatedArch := ctx.Target().NativeBridge == android.NativeBridgeEnabled
- if InstallToBootstrap(ctx.baseModuleName(), ctx.Config()) && !translatedArch && ctx.apexName() == "" && !ctx.inRamdisk() && !ctx.inRecovery() {
+ if InstallToBootstrap(ctx.baseModuleName(), ctx.Config()) && !translatedArch && ctx.apexVariationName() == "" && !ctx.inRamdisk() && !ctx.inRecovery() {
if ctx.Device() && isBionic(ctx.baseModuleName()) {
binary.installSymlinkToRuntimeApex(ctx, file)
}
diff --git a/cc/cc.go b/cc/cc.go
index 9e1c172..0132296 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -344,7 +344,7 @@
isNDKStubLibrary() bool
useClangLld(actx ModuleContext) bool
isForPlatform() bool
- apexName() string
+ apexVariationName() string
apexSdkVersion() int
hasStubsVariants() bool
isStubs() bool
@@ -1290,8 +1290,8 @@
return ctx.mod.IsForPlatform()
}
-func (ctx *moduleContextImpl) apexName() string {
- return ctx.mod.ApexName()
+func (ctx *moduleContextImpl) apexVariationName() string {
+ return ctx.mod.ApexVariationName()
}
func (ctx *moduleContextImpl) apexSdkVersion() int {
@@ -2390,7 +2390,7 @@
if ccDep.CcLibrary() && !libDepTag.static() {
depIsStubs := ccDep.BuildStubs()
depHasStubs := VersionVariantAvailable(c) && ccDep.HasStubsVariants()
- depInSameApex := android.DirectlyInApex(c.ApexName(), depName)
+ depInSameApex := android.DirectlyInApex(c.ApexVariationName(), depName)
depInPlatform := !android.DirectlyInAnyApex(ctx, depName)
var useThisDep bool
@@ -2446,7 +2446,7 @@
// by default, use current version of LLNDK
versionToUse := ""
versions := stubsVersionsFor(ctx.Config())[depName]
- if c.ApexName() != "" && len(versions) > 0 {
+ if c.ApexVariationName() != "" && len(versions) > 0 {
// if this is for use_vendor apex && dep has stubsVersions
// apply the same rule of apex sdk enforcement to choose right version
var err error
diff --git a/cc/compiler.go b/cc/compiler.go
index d0b5b46..4a42d07 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -335,10 +335,10 @@
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_RECOVERY__")
}
- if ctx.apexName() != "" {
+ if ctx.apexVariationName() != "" {
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX__")
if Bool(compiler.Properties.Use_apex_name_macro) {
- flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_"+makeDefineString(ctx.apexName())+"__")
+ flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_"+makeDefineString(ctx.apexVariationName())+"__")
}
if ctx.Device() {
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_SDK_VERSION__="+strconv.Itoa(ctx.apexSdkVersion()))