Merge "Make dirs a configurable property" into main am: 5c04707a3f

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3094914

Change-Id: I1e45d399fa997453637f3a6d78e3782fce6ef0fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 8b71e85..d2572c2 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -106,7 +106,7 @@
 	Base_dir *string
 
 	// Directories to be created under root. e.g. /dev, /proc, etc.
-	Dirs []string
+	Dirs proptools.Configurable[[]string]
 
 	// Symbolic links to be created under root with "ln -sf <target> <name>".
 	Symlinks []symlinkDefinition
@@ -243,7 +243,7 @@
 // already in `rootDir`.
 func (f *filesystem) buildNonDepsFiles(ctx android.ModuleContext, builder *android.RuleBuilder, rootDir android.OutputPath) {
 	// create dirs and symlinks
-	for _, dir := range f.properties.Dirs {
+	for _, dir := range f.properties.Dirs.GetOrDefault(ctx, nil) {
 		// OutputPath.Join verifies dir
 		builder.Command().Text("mkdir -p").Text(rootDir.Join(ctx, dir).String())
 	}