Merge "Propagate min_sdk_version to apexer" am: 97cbce163f am: ac68125f8c am: 47313f46cb

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1467830

Change-Id: Ib1f98647a244c3beded3355e139b97b070301f0e
This commit is contained in:
Nikita Ioffe
2020-10-21 18:06:47 +00:00
committed by Automerger Merge Worker

View File

@@ -21,6 +21,7 @@ import (
"path/filepath"
"runtime"
"sort"
"strconv"
"strings"
"android/soong/android"
@@ -552,14 +553,16 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
optFlags = append(optFlags, "--android_manifest "+androidManifestFile.String())
}
targetSdkVersion := ctx.Config().DefaultAppTargetSdk(ctx).String()
// TODO(b/157078772): propagate min_sdk_version to apexer.
minSdkVersion := ctx.Config().DefaultAppTargetSdk(ctx).String()
moduleMinSdkVersion := a.minSdkVersion(ctx)
if moduleMinSdkVersion.EqualTo(android.SdkVersion_Android10) {
minSdkVersion = moduleMinSdkVersion.String()
minSdkVersion := moduleMinSdkVersion.String()
// bundletool doesn't understand what "current" is. We need to transform it to codename
if moduleMinSdkVersion.IsCurrent() {
minSdkVersion = ctx.Config().DefaultAppTargetSdk(ctx).String()
}
// apex module doesn't have a concept of target_sdk_version, hence for the time being
// targetSdkVersion == default targetSdkVersion of the branch.
targetSdkVersion := strconv.Itoa(ctx.Config().DefaultAppTargetSdk(ctx).FinalOrFutureInt())
if java.UseApiFingerprint(ctx) {
targetSdkVersion = ctx.Config().PlatformSdkCodename() + fmt.Sprintf(".$$(cat %s)", java.ApiFingerprintPath(ctx).String())