diff --git a/provenance/provenance_singleton.go b/provenance/provenance_singleton.go index 142364aaa..e49f3d4f3 100644 --- a/provenance/provenance_singleton.go +++ b/provenance/provenance_singleton.go @@ -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)