From 030756ce67a340b5dbfb07c0dd664abe52b83c26 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Thu, 6 Mar 2025 18:46:23 +0000 Subject: Move phony_rule module rule generation from make to Soong So that the module behaves as expected in Soong-only build. Test: m tradefed-core Bug: 400043313 Change-Id: I6cfbcc3fb4aeb2edfc526aa345a54619239e1a81 --- phony/phony.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'phony') diff --git a/phony/phony.go b/phony/phony.go index 4f61c4583..e75f4c809 100644 --- a/phony/phony.go +++ b/phony/phony.go @@ -104,8 +104,7 @@ type PhonyRule struct { android.ModuleBase android.DefaultableModuleBase - phonyDepsModuleNames []string - properties PhonyProperties + properties PhonyProperties } type PhonyProperties struct { @@ -126,18 +125,8 @@ func PhonyRuleFactory() android.Module { } func (p *PhonyRule) GenerateAndroidBuildActions(ctx android.ModuleContext) { - p.phonyDepsModuleNames = p.properties.Phony_deps.GetOrDefault(ctx, nil) -} - -func (p *PhonyRule) AndroidMk() android.AndroidMkData { - return android.AndroidMkData{ - Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { - if len(p.phonyDepsModuleNames) > 0 { - depModulesStr := strings.Join(p.phonyDepsModuleNames, " ") - fmt.Fprintln(w, ".PHONY:", name) - fmt.Fprintln(w, name, ":", depModulesStr) - } - }, + for _, dep := range p.properties.Phony_deps.GetOrDefault(ctx, nil) { + ctx.Phony(ctx.ModuleName(), android.PathForPhony(ctx, dep)) } } -- cgit v1.2.3-59-g8ed1b