Surface Java APIs Used By APK-only Modules.

Previously we were only generating used-by API-coverage for APEX modules.
This change adds support for APK-only modules such as NetworkStack and DocumentsUI.

Bug: b/216313756
Forrest Run: https://android-build.googleplex.com/builds/abtd/run/L10800000953846781

Test: TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86 ./vendor/google/build/build_unbundled_coverage_mainline_module.sh -j16

Change-Id: Id17e4a55c2a52e9903632a654e778f8d54982dfc
Merged-In: Id17e4a55c2a52e9903632a654e778f8d54982dfc
(cherry picked from commit 56d75785bd)
This commit is contained in:
Matt Banda
2022-04-01 17:48:31 +00:00
parent 6d3c98c603
commit 8c80126987
5 changed files with 26 additions and 2 deletions

View File

@@ -258,6 +258,18 @@ func TransformJniLibsToJar(ctx android.ModuleContext, outputFile android.Writabl
})
}
func (a *AndroidApp) generateJavaUsedByApex(ctx android.ModuleContext) {
javaApiUsedByOutputFile := android.PathForModuleOut(ctx, a.installApkName+"_using.xml")
javaUsedByRule := android.NewRuleBuilder(pctx, ctx)
javaUsedByRule.Command().
Tool(android.PathForSource(ctx, "build/soong/scripts/gen_java_usedby_apex.sh")).
BuiltTool("dexdeps").
Output(javaApiUsedByOutputFile).
Input(a.Library.Module.outputFile)
javaUsedByRule.Build("java_usedby_list", "Generate Java APIs used by Apex")
a.javaApiUsedByOutputFile = javaApiUsedByOutputFile
}
func targetToJniDir(target android.Target) string {
return filepath.Join("lib", target.Arch.Abi[0])
}