diff options
author | 2024-10-08 16:17:56 -0700 | |
---|---|---|
committer | 2024-10-08 16:43:53 -0700 | |
commit | f966e387e1b1a597ef0994caaf710d6491a54a56 (patch) | |
tree | 25cf879333b787cf668815e86f2fecbe485101bc /genrule | |
parent | d6c884c58499748cfdcfd50f8f7171db6defabcf (diff) |
Remove resolved_srcs
It was unnecessary.
Test: m nothing --no-skip-soong-tests
Change-Id: I7c2f24d94bb4e388c55ec5a1d8b63a3fd5c75d09
Diffstat (limited to 'genrule')
-rw-r--r-- | genrule/genrule.go | 9 | ||||
-rw-r--r-- | genrule/genrule_test.go | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go index e5222a432..18ec0a40c 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -139,8 +139,7 @@ type generatorProperties struct { Export_include_dirs []string // list of input files - Srcs proptools.Configurable[[]string] `android:"path,arch_variant"` - ResolvedSrcs []string `blueprint:"mutated"` + Srcs proptools.Configurable[[]string] `android:"path,arch_variant"` // input files to exclude Exclude_srcs []string `android:"path,arch_variant"` @@ -426,8 +425,8 @@ func (g *Module) generateCommonBuildActions(ctx android.ModuleContext) { } return srcFiles } - g.properties.ResolvedSrcs = g.properties.Srcs.GetOrDefault(ctx, nil) - srcFiles := addLabelsForInputs("srcs", g.properties.ResolvedSrcs, g.properties.Exclude_srcs) + srcs := g.properties.Srcs.GetOrDefault(ctx, nil) + srcFiles := addLabelsForInputs("srcs", srcs, g.properties.Exclude_srcs) android.SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcFiles.Strings()}) var copyFrom android.Paths @@ -659,7 +658,7 @@ func (g *Module) setOutputFiles(ctx android.ModuleContext) { // Collect information for opening IDE project files in java/jdeps.go. func (g *Module) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) { dpInfo.Srcs = append(dpInfo.Srcs, g.Srcs().Strings()...) - for _, src := range g.properties.ResolvedSrcs { + for _, src := range g.properties.Srcs.GetOrDefault(ctx, nil) { if strings.HasPrefix(src, ":") { src = strings.Trim(src, ":") dpInfo.Deps = append(dpInfo.Deps, src) diff --git a/genrule/genrule_test.go b/genrule/genrule_test.go index 9278f1574..f190750d1 100644 --- a/genrule/genrule_test.go +++ b/genrule/genrule_test.go @@ -24,6 +24,7 @@ import ( "android/soong/android" + "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -694,8 +695,12 @@ func TestGenruleDefaults(t *testing.T) { expectedCmd := "cp in1 __SBOX_SANDBOX_DIR__/out/out" android.AssertStringEquals(t, "cmd", expectedCmd, gen.rawCommands[0]) + srcsFileProvider, ok := android.OtherModuleProvider(result.TestContext, gen, blueprint.SrcsFileProviderKey) + if !ok { + t.Fatal("Expected genrule to have a SrcsFileProviderData, but did not") + } expectedSrcs := []string{"in1"} - android.AssertDeepEquals(t, "srcs", expectedSrcs, gen.properties.ResolvedSrcs) + android.AssertDeepEquals(t, "srcs", expectedSrcs, srcsFileProvider.SrcPaths) } func TestGenruleAllowMissingDependencies(t *testing.T) { |