Merge "Export paths for the snapshot modules"
This commit is contained in:
@@ -264,6 +264,7 @@ var recoverySnapshotImageSingleton recoverySnapshotImage
|
|||||||
func init() {
|
func init() {
|
||||||
VendorSnapshotImageSingleton.Init(android.InitRegistrationContext)
|
VendorSnapshotImageSingleton.Init(android.InitRegistrationContext)
|
||||||
recoverySnapshotImageSingleton.init(android.InitRegistrationContext)
|
recoverySnapshotImageSingleton.init(android.InitRegistrationContext)
|
||||||
|
android.RegisterMakeVarsProvider(pctx, snapshotMakeVarsProvider)
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -383,6 +384,24 @@ var SnapshotInfoProvider = blueprint.NewMutatorProvider(SnapshotInfo{}, "deps")
|
|||||||
|
|
||||||
var _ android.ImageInterface = (*snapshot)(nil)
|
var _ android.ImageInterface = (*snapshot)(nil)
|
||||||
|
|
||||||
|
func snapshotMakeVarsProvider(ctx android.MakeVarsContext) {
|
||||||
|
snapshotSet := map[string]struct{}{}
|
||||||
|
ctx.VisitAllModules(func(m android.Module) {
|
||||||
|
if s, ok := m.(*snapshot); ok {
|
||||||
|
if _, ok := snapshotSet[s.Name()]; ok {
|
||||||
|
// arch variant generates duplicated modules
|
||||||
|
// skip this as we only need to know the path of the module.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
snapshotSet[s.Name()] = struct{}{}
|
||||||
|
imageNameVersion := strings.Split(s.image.imageVariantName(ctx.DeviceConfig()), ".")
|
||||||
|
ctx.Strict(
|
||||||
|
strings.Join([]string{strings.ToUpper(imageNameVersion[0]), s.baseSnapshot.Version(), "SNAPSHOT_DIR"}, "_"),
|
||||||
|
ctx.ModuleDir(s))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func vendorSnapshotFactory() android.Module {
|
func vendorSnapshotFactory() android.Module {
|
||||||
return snapshotFactory(VendorSnapshotImageSingleton)
|
return snapshotFactory(VendorSnapshotImageSingleton)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user