Add DirectoryPath for nsjail genrule
This adds a new interface DirectoryPath representing directories
specified by dirgroup modules. As directories are not regular files,
DirectoryPath is meant to be incompatible with regular Path.
Bug: 375551969
Test: m nsjail_genrule_test
Change-Id: I55806121a3a222a8b02f1a080f25448d425447b3
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 1ab1378..1282bfb 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -231,7 +231,7 @@
// For nsjail tasks
useNsjail bool
- dirSrcs android.Paths
+ dirSrcs android.DirectoryPaths
}
func (g *Module) GeneratedSourceFiles() android.Paths {
@@ -604,7 +604,8 @@
if task.useNsjail {
for _, input := range task.dirSrcs {
- cmd.Implicit(input)
+ cmd.ImplicitDirectory(input)
+ // TODO(b/375551969): remove glob
if paths, err := ctx.GlobWithDeps(filepath.Join(input.String(), "**/*"), nil); err == nil {
rule.NsjailImplicits(android.PathsForSource(ctx, paths))
} else {