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:
@@ -382,6 +382,14 @@ func (c *config) MinSupportedSdkVersion() int {
|
|||||||
return 14
|
return 14
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) DefaultAppTargetSdkInt() int {
|
||||||
|
if Bool(c.ProductVariables.Platform_sdk_final) {
|
||||||
|
return c.PlatformSdkVersionInt()
|
||||||
|
} else {
|
||||||
|
return 10000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Codenames that are active in the current lunch target.
|
// Codenames that are active in the current lunch target.
|
||||||
func (c *config) PlatformVersionActiveCodenames() []string {
|
func (c *config) PlatformVersionActiveCodenames() []string {
|
||||||
return c.ProductVariables.Platform_version_active_codenames
|
return c.ProductVariables.Platform_version_active_codenames
|
||||||
|
@@ -108,6 +108,7 @@ type productVariables struct {
|
|||||||
Make_suffix *string `json:",omitempty"`
|
Make_suffix *string `json:",omitempty"`
|
||||||
|
|
||||||
Platform_sdk_version *int `json:",omitempty"`
|
Platform_sdk_version *int `json:",omitempty"`
|
||||||
|
Platform_sdk_final *bool `json:",omitempty"`
|
||||||
Platform_version_active_codenames []string `json:",omitempty"`
|
Platform_version_active_codenames []string `json:",omitempty"`
|
||||||
Platform_version_future_codenames []string `json:",omitempty"`
|
Platform_version_future_codenames []string `json:",omitempty"`
|
||||||
|
|
||||||
|
10
java/java.go
10
java/java.go
@@ -407,6 +407,16 @@ func (j *Module) compile(ctx android.ModuleContext) {
|
|||||||
"--dump-width=1000")
|
"--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, " ")
|
flags.dxFlags = strings.Join(dxFlags, " ")
|
||||||
|
|
||||||
// Compile classes.jar into classes.dex
|
// Compile classes.jar into classes.dex
|
||||||
|
Reference in New Issue
Block a user