Merge "Put provenance_metadata.textproto in dist directory." am: 7023c80e19
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2069478
Change-Id: Id5a6521b0e2fd27863ac5086b583208f243e8624
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/provenance/provenance_singleton.go b/provenance/provenance_singleton.go
index 142364a..e49f3d4 100644
--- a/provenance/provenance_singleton.go
+++ b/provenance/provenance_singleton.go
@@ -60,27 +60,28 @@
}
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 @@
return artifactMetaDataFile
}
+
+func (p *provenanceInfoSingleton) MakeVars(ctx android.MakeVarsContext) {
+ ctx.DistForGoal("droidcore", p.mergedMetaDataFile)
+}
+
+var _ android.SingletonMakeVarsProvider = (*provenanceInfoSingleton)(nil)