Merge "Add `sdk_version: "minimum"`."

This commit is contained in:
Treehugger Robot 2017-04-01 04:49:34 +00:00 committed by Gerrit Code Review
commit fe7f2f393b
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
}