Merge "Convert some properties to Configurable properties" into main am: c6b5fdbc5c

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

Change-Id: I9d13a27541e62e82b0e23708740473d40cb15c30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2024-05-24 21:26:59 +00:00
committed by Automerger Merge Worker
4 changed files with 31 additions and 20 deletions

View File

@@ -19,6 +19,7 @@ import (
"strings"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
func init() {
@@ -36,9 +37,9 @@ func RegisterFilegroupBuildComponents(ctx RegistrationContext) {
type fileGroupProperties struct {
// srcs lists files that will be included in this filegroup
Srcs []string `android:"path"`
Srcs proptools.Configurable[[]string] `android:"path"`
Exclude_srcs []string `android:"path"`
Exclude_srcs proptools.Configurable[[]string] `android:"path"`
// The base path to the files. May be used by other modules to determine which portion
// of the path to use. For example, when a filegroup is used as data in a cc_test rule,
@@ -89,7 +90,7 @@ func (fg *fileGroup) JSONActions() []blueprint.JSONAction {
}
func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
fg.srcs = PathsForModuleSrcExcludes(ctx, fg.properties.Srcs, fg.properties.Exclude_srcs)
fg.srcs = PathsForModuleSrcExcludes(ctx, fg.properties.Srcs.GetOrDefault(ctx, nil), fg.properties.Exclude_srcs.GetOrDefault(ctx, nil))
if fg.properties.Path != nil {
fg.srcs = PathsWithModuleSrcSubDir(ctx, fg.srcs, String(fg.properties.Path))
}