Merge "Put provenance_metadata.textproto in dist directory." am: 7023c80e19 am: 003edb878a

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2069478

Change-Id: If26ecbff446b48e89c40dcaf5b509a164e9065eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Wei Li 2022-04-21 04:59:17 +00:00 committed by Automerger Merge Worker
commit 8a6bdf408a

View file

@ -60,27 +60,28 @@ func provenanceInfoSingletonFactory() android.Singleton {
}
type provenanceInfoSingleton struct {
mergedMetaDataFile android.OutputPath
}
func (b *provenanceInfoSingleton) GenerateBuildActions(context android.SingletonContext) {
func (p *provenanceInfoSingleton) GenerateBuildActions(context android.SingletonContext) {
allMetaDataFiles := make([]android.Path, 0)
context.VisitAllModulesIf(moduleFilter, func(module android.Module) {
if p, ok := module.(ProvenanceMetadata); ok {
allMetaDataFiles = append(allMetaDataFiles, p.ProvenanceMetaDataFile())
}
})
mergedMetaDataFile := android.PathForOutput(context, "provenance_metadata.textproto")
p.mergedMetaDataFile = android.PathForOutput(context, "provenance_metadata.textproto")
context.Build(pctx, android.BuildParams{
Rule: mergeProvenanceMetaData,
Description: "merge provenance metadata",
Inputs: allMetaDataFiles,
Output: mergedMetaDataFile,
Output: p.mergedMetaDataFile,
})
context.Build(pctx, android.BuildParams{
Rule: blueprint.Phony,
Description: "phony rule of merge provenance metadata",
Inputs: []android.Path{mergedMetaDataFile},
Inputs: []android.Path{p.mergedMetaDataFile},
Output: android.PathForPhony(context, "provenance_metadata"),
})
@ -112,3 +113,9 @@ func GenerateArtifactProvenanceMetaData(ctx android.ModuleContext, artifactPath
return artifactMetaDataFile
}
func (p *provenanceInfoSingleton) MakeVars(ctx android.MakeVarsContext) {
ctx.DistForGoal("droidcore", p.mergedMetaDataFile)
}
var _ android.SingletonMakeVarsProvider = (*provenanceInfoSingleton)(nil)