Merge "Translate SDK level 10000 to a valid compiler min-api" into main
This commit is contained in:
16
java/dex.go
16
java/dex.go
@@ -217,8 +217,9 @@ func (d *dexer) dexCommonFlags(ctx android.ModuleContext,
|
|||||||
// Note: Targets with a min SDK kind of core_platform (e.g., framework.jar) or unspecified (e.g.,
|
// Note: Targets with a min SDK kind of core_platform (e.g., framework.jar) or unspecified (e.g.,
|
||||||
// services.jar), are not classified as stable, which is WAI.
|
// services.jar), are not classified as stable, which is WAI.
|
||||||
// TODO(b/232073181): Expand to additional min SDK cases after validation.
|
// TODO(b/232073181): Expand to additional min SDK cases after validation.
|
||||||
|
var addAndroidPlatformBuildFlag = false
|
||||||
if !dexParams.sdkVersion.Stable() {
|
if !dexParams.sdkVersion.Stable() {
|
||||||
flags = append(flags, "--android-platform-build")
|
addAndroidPlatformBuildFlag = true
|
||||||
}
|
}
|
||||||
|
|
||||||
effectiveVersion, err := dexParams.minSdkVersion.EffectiveVersion(ctx)
|
effectiveVersion, err := dexParams.minSdkVersion.EffectiveVersion(ctx)
|
||||||
@@ -226,7 +227,18 @@ func (d *dexer) dexCommonFlags(ctx android.ModuleContext,
|
|||||||
ctx.PropertyErrorf("min_sdk_version", "%s", err)
|
ctx.PropertyErrorf("min_sdk_version", "%s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
flags = append(flags, "--min-api "+strconv.Itoa(effectiveVersion.FinalOrFutureInt()))
|
// If the specified SDK level is 10000, then configure the compiler to use the
|
||||||
|
// current platform SDK level and to compile the build as a platform build.
|
||||||
|
var minApiFlagValue = effectiveVersion.FinalOrFutureInt()
|
||||||
|
if minApiFlagValue == 10000 {
|
||||||
|
minApiFlagValue = ctx.Config().PlatformSdkVersion().FinalInt()
|
||||||
|
addAndroidPlatformBuildFlag = true
|
||||||
|
}
|
||||||
|
flags = append(flags, "--min-api "+strconv.Itoa(minApiFlagValue))
|
||||||
|
|
||||||
|
if addAndroidPlatformBuildFlag {
|
||||||
|
flags = append(flags, "--android-platform-build")
|
||||||
|
}
|
||||||
return flags, deps
|
return flags, deps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user