Add `sdk_version: "minimum"`.

This maps to the lowest supported API level for the given
architecture.

Test: make checkbuild # after setting some things to use this
Bug: None
Change-Id: Ied6d44cb2719b73f35dde38a2dca6d3c87c7c924
This commit is contained in:
Dan Albert 2017-03-29 18:22:39 -07:00
parent 30c9d6e771
commit 2e5d7d41f4
1 changed files with 10 additions and 6 deletions

View File

@ -130,6 +130,16 @@ func normalizeNdkApiLevel(apiLevel string, arch android.Arch) (string, error) {
"x86_64": 21,
}
archStr := arch.ArchType.String()
firstArchVersion, ok := firstArchVersions[archStr]
if !ok {
panic(fmt.Errorf("Arch %q not found in firstArchVersions", archStr))
}
if apiLevel == "minimum" {
return strconv.Itoa(firstArchVersion), nil
}
// If the NDK drops support for a platform version, we don't want to have to
// fix up every module that was using it as its SDK version. Clip to the
// supported version here instead.
@ -139,12 +149,6 @@ func normalizeNdkApiLevel(apiLevel string, arch android.Arch) (string, error) {
}
version = intMax(version, minVersion)
archStr := arch.ArchType.String()
firstArchVersion, ok := firstArchVersions[archStr]
if !ok {
panic(fmt.Errorf("Arch %q not found in firstArchVersions", archStr))
}
return strconv.Itoa(intMax(version, firstArchVersion)), nil
}