Soong works with empty VNDK version

This change is to fix more misc issues to enable Soong without VNDK
version. This change contains

* Update properties in generated Android.mk
* Update VNDK APEX build to work without VNDK version

Bug: 316829758
Test: AOSP Cuttlefish build succeeded
Change-Id: I10f3c798299afe2d539ec3426b8e2b6068a158f6
This commit is contained in:
Kiyoung Kim
2024-01-11 16:03:13 +09:00
parent 1c4cc3d40e
commit 8487c0b876
4 changed files with 39 additions and 24 deletions

View File

@@ -65,24 +65,27 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
}
vndkVersion := ab.vndkVersion(mctx.DeviceConfig())
apiLevel, err := android.ApiLevelFromUser(mctx, vndkVersion)
if err != nil {
mctx.PropertyErrorf("vndk_version", "%s", err.Error())
return
}
if vndkVersion != "" {
apiLevel, err := android.ApiLevelFromUser(mctx, vndkVersion)
if err != nil {
mctx.PropertyErrorf("vndk_version", "%s", err.Error())
return
}
targets := mctx.MultiTargets()
if len(targets) > 0 && apiLevel.LessThan(cc.MinApiForArch(mctx, targets[0].Arch.ArchType)) &&
vndkVersion != mctx.DeviceConfig().PlatformVndkVersion() {
// Disable VNDK APEXes for VNDK versions less than the minimum supported API
// level for the primary architecture. This validation is skipped if the VNDK
// version matches the platform VNDK version, which can occur when the device
// config targets the 'current' VNDK (see `vndkVersion`).
ab.Disable()
}
if proptools.String(ab.vndkProperties.Vndk_version) != "" &&
apiLevel.GreaterThanOrEqualTo(android.ApiLevelOrPanic(mctx, mctx.DeviceConfig().PlatformVndkVersion())) {
ab.Disable()
targets := mctx.MultiTargets()
if len(targets) > 0 && apiLevel.LessThan(cc.MinApiForArch(mctx, targets[0].Arch.ArchType)) &&
vndkVersion != mctx.DeviceConfig().PlatformVndkVersion() {
// Disable VNDK APEXes for VNDK versions less than the minimum supported API
// level for the primary architecture. This validation is skipped if the VNDK
// version matches the platform VNDK version, which can occur when the device
// config targets the 'current' VNDK (see `vndkVersion`).
ab.Disable()
}
if proptools.String(ab.vndkProperties.Vndk_version) != "" &&
mctx.DeviceConfig().PlatformVndkVersion() != "" &&
apiLevel.GreaterThanOrEqualTo(android.ApiLevelOrPanic(mctx, mctx.DeviceConfig().PlatformVndkVersion())) {
ab.Disable()
}
}
}
}
@@ -94,6 +97,11 @@ func apexVndkDepsMutator(mctx android.BottomUpMutatorContext) {
if vndkVersion == "" {
vndkVersion = mctx.DeviceConfig().PlatformVndkVersion()
}
if vndkVersion == "" {
return
}
if vndkVersion == mctx.DeviceConfig().PlatformVndkVersion() {
vndkVersion = "current"
} else {