TARGET_FS_CONFIG_GEN is a list, not a single path

Bug: 130787336
Test: m oemaids_header_gen oemaids_headers passwd group
Test: Set TARGET_FS_CONFIG_GEN to a list of paths
Change-Id: I5186b378fea8865f46cfd891420ba576f36e2565
This commit is contained in:
Dan Willemsen
2019-04-18 10:10:34 -07:00
parent aa0aa5e5c8
commit 7f25f2aed9
3 changed files with 10 additions and 10 deletions

View File

@@ -24,7 +24,7 @@ func init() {
android.RegisterModuleType("target_fs_config_gen_filegroup", targetFSConfigGenFactory)
}
// target_fs_config_gen_filegroup is used to expose the file pointed to by TARGET_FS_CONFIG_GEN to
// target_fs_config_gen_filegroup is used to expose the files pointed to by TARGET_FS_CONFIG_GEN to
// genrules in Soong. If TARGET_FS_CONFIG_GEN is empty, it will export an empty file instead.
func targetFSConfigGenFactory() android.Module {
module := &targetFSConfigGen{}
@@ -36,17 +36,17 @@ var _ android.SourceFileProducer = (*targetFSConfigGen)(nil)
type targetFSConfigGen struct {
android.ModuleBase
path android.Path
paths android.Paths
}
func (targetFSConfigGen) DepsMutator(ctx android.BottomUpMutatorContext) {}
func (t *targetFSConfigGen) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if ret := ctx.DeviceConfig().TargetFSConfigGen(); ret != nil && *ret != "" {
t.path = android.PathForSource(ctx, *ret)
if ret := ctx.DeviceConfig().TargetFSConfigGen(); len(ret) != 0 {
t.paths = android.PathsForSource(ctx, ret)
} else {
path := android.PathForModuleGen(ctx, "empty")
t.path = path
t.paths = android.Paths{path}
rule := android.NewRuleBuilder()
rule.Command().Text("rm -rf").Output(path)
@@ -56,5 +56,5 @@ func (t *targetFSConfigGen) GenerateAndroidBuildActions(ctx android.ModuleContex
}
func (t *targetFSConfigGen) Srcs() android.Paths {
return android.Paths{t.path}
return t.paths
}