Deprecate Snapshot build

Existing snapshot code will no longer work from VNDK deprecation, but it
can give confusion to users if we keep code for the snapshot - and it
adds complexity on existing code while it is not in use. This change
removes all snapshot definition except host snapshot and its usage.

Bug: 330100430
Bug: 332986564
Test: AOSP CF build succeeded
Change-Id: Ieb6fa43d5e38315c662ce997bc305b744b367c24
This commit is contained in:
Kiyoung Kim
2024-04-04 09:56:15 +09:00
parent 4caca1d797
commit 37693d0a27
37 changed files with 85 additions and 3853 deletions

View File

@@ -15,14 +15,12 @@
package cc
import (
"encoding/json"
"path/filepath"
"testing"
"android/soong/android"
"android/soong/genrule"
"android/soong/multitree"
"android/soong/snapshot"
)
func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
@@ -702,10 +700,6 @@ func CreateTestContext(config android.Config) *android.TestContext {
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("vndk_prebuilt_shared", VndkPrebuiltSharedFactory)
snapshot.VendorSnapshotImageSingleton.Init(ctx)
snapshot.RecoverySnapshotImageSingleton.Init(ctx)
RegisterVendorSnapshotModules(ctx)
RegisterRecoverySnapshotModules(ctx)
RegisterVndkLibraryTxtTypes(ctx)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
@@ -759,14 +753,6 @@ func CheckSnapshotRule(t *testing.T, ctx *android.TestContext, singleton android
checkSnapshotIncludeExclude(t, ctx, singleton, moduleName, snapshotFilename, subDir, variant, true, true)
}
func AssertExcludeFromVendorSnapshotIs(t *testing.T, ctx *android.TestContext, name string, expected bool, variant string) {
t.Helper()
m := ctx.ModuleForTests(name, variant).Module().(LinkableInterface)
if m.ExcludeFromVendorSnapshot() != expected {
t.Errorf("expected %q ExcludeFromVendorSnapshot to be %t", m.String(), expected)
}
}
func GetOutputPaths(ctx *android.TestContext, variant string, moduleNames []string) (paths android.Paths) {
for _, moduleName := range moduleNames {
module := ctx.ModuleForTests(moduleName, variant).Module().(*Module)
@@ -775,30 +761,3 @@ func GetOutputPaths(ctx *android.TestContext, variant string, moduleNames []stri
}
return paths
}
func AssertExcludeFromRecoverySnapshotIs(t *testing.T, ctx *android.TestContext, name string, expected bool, variant string) {
t.Helper()
m := ctx.ModuleForTests(name, variant).Module().(LinkableInterface)
if m.ExcludeFromRecoverySnapshot() != expected {
t.Errorf("expected %q ExcludeFromRecoverySnapshot to be %t", m.String(), expected)
}
}
func checkOverrides(t *testing.T, ctx *android.TestContext, singleton android.TestingSingleton, jsonPath string, expected []string) {
t.Helper()
out := singleton.MaybeOutput(jsonPath)
content := android.ContentFromFileRuleForTests(t, ctx, out)
var flags snapshotJsonFlags
if err := json.Unmarshal([]byte(content), &flags); err != nil {
t.Errorf("Error while unmarshalling json %q: %s", jsonPath, err.Error())
return
}
for _, moduleName := range expected {
if !android.InList(moduleName, flags.Overrides) {
t.Errorf("expected %q to be in %q: %q", moduleName, flags.Overrides, content)
return
}
}
}