From 82d502a7b26756ee4cd75c1b7f153a3bdcbf9900 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Wed, 11 Nov 2020 12:33:14 +0000 Subject: [PATCH] Make apex modules support tagged dists Bug: 172951145 Test: m dist my_dist_target (with patch in bug) Change-Id: I0da4568a49ea48efbf864614a7e7c647f251a7ce --- apex/androidmk.go | 4 ++++ apex/apex.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apex/androidmk.go b/apex/androidmk.go index ee8b2b321..993260c7e 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -307,6 +307,7 @@ func (a *apexBundle) writeRequiredModules(w io.Writer) { func (a *apexBundle) androidMkForType() android.AndroidMkData { return android.AndroidMkData{ + DistFiles: a.distFiles, Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { moduleNames := []string{} apexType := a.properties.ApexType @@ -391,6 +392,9 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", goal, a.installedFilesFile.String(), distFile) } + for _, dist := range data.Entries.GetDistForGoals(a) { + fmt.Fprintf(w, dist) + } } }} } diff --git a/apex/apex.go b/apex/apex.go index fdc105e37..826896654 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1477,6 +1477,8 @@ type apexBundle struct { lintReports android.Paths payloadFsType fsType + + distFiles android.TaggedDistFiles } func addDependenciesForNativeModules(ctx android.BottomUpMutatorContext, @@ -2522,6 +2524,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.buildApexDependencyInfo(ctx) a.buildLintReports(ctx) + + a.distFiles = a.GenerateTaggedDistFiles(ctx) } // Enforce that Java deps of the apex are using stable SDKs to compile