Check updatable APKs compile against managed SDKs.

As a follow up, this property will be set to APKs participating in mainline program.

Bug: 153333044
Test: m
Change-Id: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
Merged-In: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
(cherry picked from commit 2db1c3f1c4)
Exempt-From-Owner-Approval: clean cherry-pick
This commit is contained in:
Artur Satayev
2020-04-08 19:09:30 +01:00
parent ee42b2079d
commit e5ac15a1b7
4 changed files with 154 additions and 13 deletions

View File

@@ -147,6 +147,10 @@ type sdkSpec struct {
raw string
}
func (s sdkSpec) String() string {
return fmt.Sprintf("%s_%s", s.kind, s.version)
}
// valid checks if this sdkSpec is well-formed. Note however that true doesn't mean that the
// specified SDK actually exists.
func (s sdkSpec) valid() bool {
@@ -158,6 +162,23 @@ func (s sdkSpec) specified() bool {
return s.valid() && s.kind != sdkPrivate
}
// whether the API surface is managed and versioned, i.e. has .txt file that
// get frozen on SDK freeze and changes get reviewed by API council.
func (s sdkSpec) stable() bool {
if !s.specified() {
return false
}
switch s.kind {
case sdkCore, sdkPublic, sdkSystem, sdkModule, sdkSystemServer:
return true
case sdkNone, sdkCorePlatform, sdkTest, sdkPrivate:
return false
default:
panic(fmt.Errorf("unknown sdkKind=%v", s.kind))
}
return false
}
// prebuiltSdkAvailableForUnbundledBuilt tells whether this sdkSpec can have a prebuilt SDK
// that can be used for unbundled builds.
func (s sdkSpec) prebuiltSdkAvailableForUnbundledBuild() bool {