Use target specific intermediate paths
This won't be harmful and this can help reduce rebuilding sepolicy
artifacts upon lunch target change.
Bug: 279524023
Test: m selinux_policy
Change-Id: I859de6dc0ac1958b44d847159904960bd7f9a0c2
diff --git a/build/soong/policy.go b/build/soong/policy.go
index aea8e09..7c1aab2 100644
--- a/build/soong/policy.go
+++ b/build/soong/policy.go
@@ -209,7 +209,7 @@
}
func (c *policyConf) transformPolicyToConf(ctx android.ModuleContext) android.OutputPath {
- conf := android.PathForModuleOut(ctx, c.stem()).OutputPath
+ conf := pathForModuleOut(ctx, c.stem())
rule := android.NewRuleBuilder(pctx, ctx)
srcs := android.PathsForModuleSrc(ctx, c.properties.Srcs)
@@ -340,7 +340,7 @@
}
func (c *policyCil) compileConfToCil(ctx android.ModuleContext, conf android.Path) android.OutputPath {
- cil := android.PathForModuleOut(ctx, c.stem()).OutputPath
+ cil := pathForModuleOut(ctx, c.stem())
rule := android.NewRuleBuilder(pctx, ctx)
checkpolicyCmd := rule.Command().BuiltTool("checkpolicy").
Flag("-C"). // Write CIL
@@ -496,7 +496,7 @@
ctx.PropertyErrorf("srcs", "must be specified")
return
}
- bin := android.PathForModuleOut(ctx, c.stem()+"_policy")
+ bin := pathForModuleOut(ctx, c.stem()+"_policy")
rule := android.NewRuleBuilder(pctx, ctx)
secilcCmd := rule.Command().BuiltTool("secilc").
Flag("-m"). // Multiple decls
@@ -514,7 +514,7 @@
// permissive check is performed only in user build (not debuggable).
if !ctx.Config().Debuggable() {
- permissiveDomains := android.PathForModuleOut(ctx, c.stem()+"_permissive")
+ permissiveDomains := pathForModuleOut(ctx, c.stem()+"_permissive")
cmd := rule.Command().BuiltTool("sepolicy-analyze").
Input(bin).
Text("permissive")
@@ -544,7 +544,7 @@
Text("; exit 1; fi")
}
- out := android.PathForModuleOut(ctx, c.stem())
+ out := pathForModuleOut(ctx, c.stem())
rule.Command().Text("cp").
Flag("-f").
Input(bin).