summaryrefslogtreecommitdiff
path: root/java/sdk.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2019-06-11 12:31:14 +0100
committer Paul Duffin <paulduffin@google.com> 2019-06-13 19:15:10 +0100
commit52d398a84197053a624c13a0bc1cfb78df996966 (patch)
treed65ee1085e8111e36abc2f1d42b1400de1434d61 /java/sdk.go
parent250e6198d45d7d29bea4c121d42afc8cb6a672d9 (diff)
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
Diffstat (limited to 'java/sdk.go')
-rw-r--r--java/sdk.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/sdk.go b/java/sdk.go
index 76d36f6bd..9dfb38bf4 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -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":