Make the enabled property configurable
This allows using select statements with it. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191 Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
This commit is contained in:
@@ -18,6 +18,7 @@ package provenance
|
||||
|
||||
import (
|
||||
"android/soong/android"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
)
|
||||
|
||||
@@ -68,6 +69,15 @@ type provenanceInfoSingleton struct {
|
||||
|
||||
func (p *provenanceInfoSingleton) GenerateBuildActions(context android.SingletonContext) {
|
||||
allMetaDataFiles := make([]android.Path, 0)
|
||||
moduleFilter := func(module android.Module) bool {
|
||||
if !module.Enabled(context) || module.IsSkipInstall() {
|
||||
return false
|
||||
}
|
||||
if p, ok := module.(ProvenanceMetadata); ok {
|
||||
return p.ProvenanceMetaDataFile().String() != ""
|
||||
}
|
||||
return false
|
||||
}
|
||||
context.VisitAllModulesIf(moduleFilter, func(module android.Module) {
|
||||
if p, ok := module.(ProvenanceMetadata); ok {
|
||||
allMetaDataFiles = append(allMetaDataFiles, p.ProvenanceMetaDataFile())
|
||||
@@ -91,16 +101,6 @@ func (p *provenanceInfoSingleton) GenerateBuildActions(context android.Singleton
|
||||
context.Phony("droidcore", android.PathForPhony(context, "provenance_metadata"))
|
||||
}
|
||||
|
||||
func moduleFilter(module android.Module) bool {
|
||||
if !module.Enabled() || module.IsSkipInstall() {
|
||||
return false
|
||||
}
|
||||
if p, ok := module.(ProvenanceMetadata); ok {
|
||||
return p.ProvenanceMetaDataFile().String() != ""
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func GenerateArtifactProvenanceMetaData(ctx android.ModuleContext, artifactPath android.Path, installedFile android.InstallPath) android.OutputPath {
|
||||
onDevicePathOfInstalledFile := android.InstallPathToOnDevicePath(ctx, installedFile)
|
||||
artifactMetaDataFile := android.PathForIntermediates(ctx, "provenance_metadata", ctx.ModuleDir(), ctx.ModuleName(), "provenance_metadata.textproto")
|
||||
|
Reference in New Issue
Block a user