Pass --min-sdk-version to dx

Pass the sdk_version property, the platform sdk version, or 10000
to dx as --min-sdk-version.

Test: m -j checkbuild
Change-Id: I5fae03f44153dc2d6244c33f4c055e746980aefe
This commit is contained in:
Colin Cross
2017-08-31 12:30:37 -07:00
parent 5c51792926
commit 595a406f88
3 changed files with 19 additions and 0 deletions

View File

@@ -407,6 +407,16 @@ func (j *Module) compile(ctx android.ModuleContext) {
"--dump-width=1000")
}
var minSdkVersion string
switch j.deviceProperties.Sdk_version {
case "", "current", "test_current", "system_current":
minSdkVersion = strconv.Itoa(ctx.AConfig().DefaultAppTargetSdkInt())
default:
minSdkVersion = j.deviceProperties.Sdk_version
}
dxFlags = append(dxFlags, "--min-sdk-version="+minSdkVersion)
flags.dxFlags = strings.Join(dxFlags, " ")
// Compile classes.jar into classes.dex