summaryrefslogtreecommitdiff
path: root/apex/builder.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/builder.go
parentcb16a92ee4b546dbc7b554193d5dbd59034c87c9 (diff)
parent0234737f305252f011a24231ee31f4401d6bd72e (diff)
Merge "Java APIs used by Mainline modules."
Diffstat (limited to 'apex/builder.go')
-rw-r--r--apex/builder.go27
1 files changed, 22 insertions, 5 deletions
diff --git a/apex/builder.go b/apex/builder.go
index e22d69411..2e21ddfa1 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -67,6 +67,7 @@ func init() {
pctx.HostBinToolVariable("sload_f2fs", "sload_f2fs")
pctx.HostBinToolVariable("make_erofs", "make_erofs")
pctx.HostBinToolVariable("apex_compression_tool", "apex_compression_tool")
+ pctx.HostBinToolVariable("dexdeps", "dexdeps")
pctx.SourcePathVariable("genNdkUsedbyApexPath", "build/soong/scripts/gen_ndk_usedby_apex.sh")
}
@@ -707,12 +708,12 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
"readelf": "${config.ClangBin}/llvm-readelf",
},
})
- a.apisUsedByModuleFile = apisUsedbyOutputFile
+ a.nativeApisUsedByModuleFile = apisUsedbyOutputFile
- var libNames []string
+ var nativeLibNames []string
for _, f := range a.filesInfo {
if f.class == nativeSharedLib {
- libNames = append(libNames, f.stem())
+ nativeLibNames = append(nativeLibNames, f.stem())
}
}
apisBackedbyOutputFile := android.PathForModuleOut(ctx, a.Name()+"_backing.txt")
@@ -720,9 +721,25 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
rule.Command().
Tool(android.PathForSource(ctx, "build/soong/scripts/gen_ndk_backedby_apex.sh")).
Output(apisBackedbyOutputFile).
- Flags(libNames)
+ Flags(nativeLibNames)
rule.Build("ndk_backedby_list", "Generate API libraries backed by Apex")
- a.apisBackedByModuleFile = apisBackedbyOutputFile
+ a.nativeApisBackedByModuleFile = apisBackedbyOutputFile
+
+ var javaLibOrApkPath []android.Path
+ for _, f := range a.filesInfo {
+ if f.class == javaSharedLib || f.class == app {
+ javaLibOrApkPath = append(javaLibOrApkPath, f.builtFile)
+ }
+ }
+ javaApiUsedbyOutputFile := android.PathForModuleOut(ctx, a.Name()+"_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).
+ Inputs(javaLibOrApkPath)
+ javaUsedByRule.Build("java_usedby_list", "Generate Java APIs used by Apex")
+ a.javaApisUsedByModuleFile = javaApiUsedbyOutputFile
bundleConfig := a.buildBundleConfig(ctx)