summaryrefslogtreecommitdiff
path: root/phony
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2025-03-06 18:46:23 +0000
committer Jihoon Kang <jihoonkang@google.com> 2025-03-06 18:48:18 +0000
commit030756ce67a340b5dbfb07c0dd664abe52b83c26 (patch)
tree68831731b895d87844f9454e37512734722c892c /phony
parentde3a5c4be8aff15998cbf898e06fcc4679fe911f (diff)
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
Diffstat (limited to 'phony')
-rw-r--r--phony/phony.go17
1 files changed, 3 insertions, 14 deletions
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))
}
}