Use OutputFilesProvider on certain module types
The module types below no longer implement OutputFileProducer, but
use OutputFilesProvider for output files inter-module-communication.
se_policy_conf
se_policy_cil
se_policy_binary
se_compat_cil
se_versioned_policy
Test: CI
Bug: 339477385
Change-Id: I87d1845162f91065acd7d2f6c27fd7583cc8b5e0
diff --git a/build/soong/policy.go b/build/soong/policy.go
index be9d34e..7b2122c 100644
--- a/build/soong/policy.go
+++ b/build/soong/policy.go
@@ -15,7 +15,6 @@
package selinux
import (
- "fmt"
"os"
"sort"
"strconv"
@@ -294,6 +293,8 @@
c.installSource = c.transformPolicyToConf(ctx)
c.installPath = android.PathForModuleInstall(ctx, "etc")
ctx.InstallFile(c.installPath, c.stem(), c.installSource)
+
+ ctx.SetOutputFiles(android.Paths{c.installSource}, "")
}
func (c *policyConf) AndroidMkEntries() []android.AndroidMkEntries {
@@ -310,15 +311,6 @@
}}
}
-func (c *policyConf) OutputFiles(tag string) (android.Paths, error) {
- if tag == "" {
- return android.Paths{c.installSource}, nil
- }
- return nil, fmt.Errorf("Unknown tag %q", tag)
-}
-
-var _ android.OutputFileProducer = (*policyConf)(nil)
-
type policyCilProperties struct {
// Name of the output. Default is {module_name}
Stem *string
@@ -457,6 +449,8 @@
}
c.installSource = cil
ctx.InstallFile(c.installPath, c.stem(), c.installSource)
+
+ ctx.SetOutputFiles(android.Paths{c.installSource}, "")
}
func (c *policyCil) AndroidMkEntries() []android.AndroidMkEntries {
@@ -473,15 +467,6 @@
}}
}
-func (c *policyCil) OutputFiles(tag string) (android.Paths, error) {
- if tag == "" {
- return android.Paths{c.installSource}, nil
- }
- return nil, fmt.Errorf("Unknown tag %q", tag)
-}
-
-var _ android.OutputFileProducer = (*policyCil)(nil)
-
type policyBinaryProperties struct {
// Name of the output. Default is {module_name}
Stem *string
@@ -604,6 +589,8 @@
}
c.installSource = out
ctx.InstallFile(c.installPath, c.stem(), c.installSource)
+
+ ctx.SetOutputFiles(android.Paths{c.installSource}, "")
}
func (c *policyBinary) AndroidMkEntries() []android.AndroidMkEntries {
@@ -619,12 +606,3 @@
},
}}
}
-
-func (c *policyBinary) OutputFiles(tag string) (android.Paths, error) {
- if tag == "" {
- return android.Paths{c.installSource}, nil
- }
- return nil, fmt.Errorf("Unknown tag %q", tag)
-}
-
-var _ android.OutputFileProducer = (*policyBinary)(nil)