diff options
author | 2023-09-20 13:41:30 +0000 | |
---|---|---|
committer | 2023-09-28 13:21:21 +0000 | |
commit | 57162c515ea0bae374bec0744d4c3cc89505032d (patch) | |
tree | 73fe8789c6cf40f43c58d63574e786898b44c681 /java/platform_bootclasspath.go | |
parent | 0e73f9ee6db05504a5a586b931645a3da51ed9a8 (diff) |
Add srcjar output for platform_bootclasspath
This output contains all the transitive sources that are contained in
the bootclasspath.
It's currently limited to source-built bootclasspath components. Future
work will make this deal with sdk_library prebuilts.
Bug: 151360309
Test: unit test, as well as manual inspection of platform-bootclasspath
Change-Id: Ie05d8125e19736d8b4b9ebafb70b88a0a40069d5
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index ade739552..bab0bf614 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -173,6 +173,18 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo allModules = append(allModules, apexModules...) b.configuredModules = allModules + var transitiveSrcFiles android.Paths + for _, module := range allModules { + depInfo := ctx.OtherModuleProvider(module, JavaInfoProvider).(JavaInfo) + if depInfo.TransitiveSrcFiles != nil { + transitiveSrcFiles = append(transitiveSrcFiles, depInfo.TransitiveSrcFiles.ToList()...) + } + } + jarArgs := resourcePathsToJarArgs(transitiveSrcFiles) + jarArgs = append(jarArgs, "-srcjar") // Move srcfiles to the right package + transitiveSrcJar := android.PathForModuleOut(ctx, ctx.ModuleName()+"-transitive.srcjar") + TransformResourcesToJar(ctx, transitiveSrcJar, jarArgs, transitiveSrcFiles) + // Gather all the fragments dependencies. b.fragments = gatherApexModulePairDepsWithTag(ctx, bootclasspathFragmentDepTag) |