Java APIs used by Mainline modules.

Add scripts to generate java APIs used by Mainline modules. This is
aosp/1879177 with fixed build error that caused by dexdeps analyzing
resource only APKs which doesn't contains any .dex files. Now skip the
error generates in that case in gen_java_usedby_apex.sh

Forrest run:https://android-build.googleplex.com/builds/abtd/run/L38900000951898586

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: Id539cbe1b7306ace69c047f95ffc02265a467511
This commit is contained in:
sophiez
2021-11-02 17:58:02 -07:00
committed by Sophie Zheng
parent 9de51af72c
commit 0234737f30
6 changed files with 85 additions and 25 deletions

View File

@@ -446,23 +446,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)
}
}