Put provenance_metadata.textproto in dist directory.

Bug: 217434690
Test: m dist
Change-Id: I2f0d51846b3aad48c923c2f281ed42b6d4fe2a1d
This commit is contained in:
Wei Li 2022-04-20 23:59:47 +00:00
parent 0c9d27c463
commit 7cf80a65a8

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)