Separate snapshot definition
Current snapshot definition is located in the CC module, so it is
difficult to capture non-CC module (such as prebuilt_etc) to the
snapshot. Separate general snapshot definition from cc so other modules
can also define its own snapshot.
Bug: 192430376
Test: m nothing passed
Change-Id: Ifb69fb3d2ec555b629aa31ec03e7ce5831fd3063
diff --git a/cc/genrule.go b/cc/genrule.go
index b0efc6c..0ca901e 100644
--- a/cc/genrule.go
+++ b/cc/genrule.go
@@ -17,6 +17,7 @@
import (
"android/soong/android"
"android/soong/genrule"
+ "android/soong/snapshot"
)
func init() {
@@ -84,7 +85,7 @@
// is not needed.
recoverySnapshotVersion := ctx.DeviceConfig().RecoverySnapshotVersion()
if recoverySnapshotVersion != "current" && recoverySnapshotVersion != "" &&
- !isRecoveryProprietaryModule(ctx) {
+ !snapshot.IsRecoveryProprietaryModule(ctx) {
return false
} else {
return Bool(g.Recovery_available)
@@ -103,7 +104,7 @@
// If not, we assume modules under proprietary paths are compatible for
// BOARD_VNDK_VERSION. The other modules are regarded as AOSP, that is
// PLATFORM_VNDK_VERSION.
- if vndkVersion == "current" || !IsVendorProprietaryModule(ctx) {
+ if vndkVersion == "current" || !snapshot.IsVendorProprietaryModule(ctx) {
variants = append(variants, VendorVariationPrefix+ctx.DeviceConfig().PlatformVndkVersion())
} else {
variants = append(variants, VendorVariationPrefix+vndkVersion)