SdkTestCore for non-updatable modules

Provides SdkTestCore/test_core_current sdk_version for non-updatable
modules that have their test scope dependent on test apis from
framework-minus-apex.

Ignore-AOSP-First: Change in topic with internal-first projects
Bug: 289776578
Test: m checkapi | go test ./java

Merged-In: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
Change-Id: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
This commit is contained in:
Mark White
2023-08-10 00:07:03 +00:00
committed by Anton Hansson
parent c70be4b986
commit 9421c4ceb9
4 changed files with 45 additions and 4 deletions

View File

@@ -48,6 +48,7 @@ const (
SdkPublic
SdkSystem
SdkTest
SdkTestFrameworksCore
SdkModule
SdkSystemServer
SdkPrivate
@@ -67,6 +68,8 @@ func (k SdkKind) String() string {
return "system"
case SdkTest:
return "test"
case SdkTestFrameworksCore:
return "test_frameworks_core"
case SdkCore:
return "core"
case SdkCorePlatform:
@@ -92,6 +95,8 @@ func (k SdkKind) DefaultJavaLibraryName() string {
return "android_system_stubs_current"
case SdkTest:
return "android_test_stubs_current"
case SdkTestFrameworksCore:
return "android_test_frameworks_core_stubs_current"
case SdkCore:
return "core.current.stubs"
case SdkModule:
@@ -137,7 +142,7 @@ func (s SdkSpec) Stable() bool {
return true
case SdkCore, SdkPublic, SdkSystem, SdkModule, SdkSystemServer:
return true
case SdkCorePlatform, SdkTest, SdkPrivate:
case SdkCorePlatform, SdkTest, SdkTestFrameworksCore, SdkPrivate:
return false
default:
panic(fmt.Errorf("unknown SdkKind=%v", s.Kind))
@@ -185,7 +190,8 @@ func (s SdkSpec) UsePrebuilt(ctx EarlyModuleContext) bool {
return ctx.Config().AlwaysUsePrebuiltSdks()
} else if !s.ApiLevel.IsPreview() {
// validation check
if s.Kind != SdkPublic && s.Kind != SdkSystem && s.Kind != SdkTest && s.Kind != SdkModule && s.Kind != SdkSystemServer {
if s.Kind != SdkPublic && s.Kind != SdkSystem && s.Kind != SdkTest &&
s.Kind != SdkTestFrameworksCore && s.Kind != SdkModule && s.Kind != SdkSystemServer {
panic(fmt.Errorf("prebuilt SDK is not not available for SdkKind=%q", s.Kind))
return false
}
@@ -266,6 +272,8 @@ func SdkSpecFromWithConfig(config Config, str string) SdkSpec {
kind = SdkSystem
case "test":
kind = SdkTest
case "test_frameworks_core":
kind = SdkTestFrameworksCore
case "module":
kind = SdkModule
case "system_server":