Add sdk_version:"none" to replace no_standard_libs:true

Where possible this duplicates any tests that use no_standard_libs:true
with ones that use sdk_version:"none". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"none" to ensure that there is no regression in the
behavior of no_standard_libs:true.

Follow up changes will switch all usages of no_standard_libs:true over
to use sdk_version:"none" at which point no_standard_libs will be
removed.

Bug: 134566750
Test: m droid
Change-Id: I5f0fd3daa980f6b223abe454cba7f25a97a39d7a
This commit is contained in:
Paul Duffin
2019-06-11 12:31:14 +01:00
parent 250e6198d4
commit 52d398a841
8 changed files with 96 additions and 15 deletions

View File

@@ -54,7 +54,7 @@ type sdkContext interface {
func sdkVersionOrDefault(ctx android.BaseModuleContext, v string) string {
switch v {
case "", "current", "system_current", "test_current", "core_current":
case "", "none", "current", "system_current", "test_current", "core_current":
return ctx.Config().DefaultAppTargetSdk()
default:
return v
@@ -65,7 +65,7 @@ func sdkVersionOrDefault(ctx android.BaseModuleContext, v string) string {
// it returns android.FutureApiLevel (10000).
func sdkVersionToNumber(ctx android.BaseModuleContext, v string) (int, error) {
switch v {
case "", "current", "test_current", "system_current", "core_current":
case "", "none", "current", "test_current", "system_current", "core_current":
return ctx.Config().DefaultAppTargetSdkInt(), nil
default:
n := android.GetNumericSdkVersion(v)
@@ -187,7 +187,7 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
}
}
if ctx.Config().UnbundledBuildUsePrebuiltSdks() && v != "" {
if ctx.Config().UnbundledBuildUsePrebuiltSdks() && v != "" && v != "none" {
return toPrebuilt(v)
}
@@ -201,6 +201,10 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
noStandardLibs: sdkContext.noStandardLibs(),
noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
case "none":
return sdkDep{
noStandardLibs: true,
}
case "current":
return toModule("android_stubs_current", "framework-res", sdkFrameworkAidlPath(ctx))
case "system_current":