summaryrefslogtreecommitdiff
path: root/apex/androidmk.go
diff options
context:
space:
mode:
author Sophie Zheng <sophiez@google.com> 2021-11-15 06:40:31 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-11-15 06:40:31 +0000
commit7b5fa4277f30287b2bbafeaf9ef146b79176e15c (patch)
tree6c74035a77a5df4401f304b7a65bf3cb222e3544 /apex/androidmk.go
parentcb16a92ee4b546dbc7b554193d5dbd59034c87c9 (diff)
parent0234737f305252f011a24231ee31f4401d6bd72e (diff)
Merge "Java APIs used by Mainline modules."
Diffstat (limited to 'apex/androidmk.go')
-rw-r--r--apex/androidmk.go29
1 files changed, 12 insertions, 17 deletions
diff --git a/apex/androidmk.go b/apex/androidmk.go
index 80237fb5f..4f37fc3d5 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -449,23 +449,18 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
fmt.Fprintf(w, dist)
}
- if a.apisUsedByModuleFile.String() != "" {
- goal := "apps_only"
- distFile := a.apisUsedByModuleFile.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\n",
- goal, distFile, distFile)
- }
-
- if a.apisBackedByModuleFile.String() != "" {
- goal := "apps_only"
- distFile := a.apisBackedByModuleFile.String()
- fmt.Fprintf(w, "ifneq (,$(filter $(my_register_name),$(TARGET_BUILD_APPS)))\n"+
- " $(call dist-for-goals,%s,%s:ndk_apis_backedby_apex/$(notdir %s))\n"+
- "endif\n",
- goal, distFile, distFile)
- }
+ distCoverageFiles(w, "ndk_apis_usedby_apex", a.nativeApisUsedByModuleFile.String())
+ distCoverageFiles(w, "ndk_apis_usedby_apex", a.nativeApisBackedByModuleFile.String())
+ distCoverageFiles(w, "java_apis_used_by_apex", a.javaApisUsedByModuleFile.String())
}
}}
}
+
+func distCoverageFiles(w io.Writer, dir string, distfile string) {
+ if distfile != "" {
+ goal := "apps_only"
+ fmt.Fprintf(w, "ifneq (,$(filter $(my_register_name),$(TARGET_BUILD_APPS)))\n"+
+ " $(call dist-for-goals,%s,%s:%s/$(notdir %s))\n"+
+ "endif\n", goal, distfile, dir, distfile)
+ }
+}