From 55e8815fb8d40abe2eba95190bd41843e556966d Mon Sep 17 00:00:00 2001 From: sophiez Date: Thu, 3 Dec 2020 23:53:15 +0000 Subject: [PATCH] Automate NDK API coverage used by Mainline modules build integration Dist txt files containing NDK APIs used by Mainline modules Test: TARGET_BUILD_APPS=com.google.android.adbd m dist apps_only Change-Id: I035f1e0cc7eb43fc09e796dbc6ce77e65b8aa3b4 --- apex/androidmk.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apex/androidmk.go b/apex/androidmk.go index da38c2ac8..61b9dad59 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -421,6 +421,15 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { for _, dist := range data.Entries.GetDistForGoals(a) { fmt.Fprintf(w, dist) } + + if a.coverageOutputPath.String() != "" { + goal := "apps_only" + distFile := a.coverageOutputPath.String() + fmt.Fprintf(w, "ifneq (,$(filter $(my_register_name),$(TARGET_BUILD_APPS)))\n"+ + " $(call dist-for-goals,%s,%s:ndk_apis_usedby_apex/$(notdir %s))\n"+ + "endif", + goal, distFile, distFile) + } } }} }