Use transitive header jars in classpaths

Skip combining jars into turbine-combined, combined, and withres jars
and instead collect transitive jars to use in the classpath and to
produce the final dexed jar.

This reduces the size of a `m checkbuild` in git_main by 11%, from
1300 KiB to 1154 KiB.  It may also improve caching and reduce uplink
network bandwidth when building with RBE, as now the classpath inputs
to rules are themselves outputs of previous rules and so already in
the RBE CAS.

The downside is that the classpath inputs to each rule are now much
longer, increasing the Soong ninja file size 11%, from 4.6 GiB to
5.1 GiB.  This could be mitigated in the future by supporting something
like depsets in the generated ninja file to reduce duplication.

Bug: 308016794
Test: TestSimple, TestKotlin, TestClasspath
Flag: build.RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH
Change-Id: I2b7b4261375494370da70f98597c8719f1d561cf
This commit is contained in:
Colin Cross
2024-07-26 15:25:46 -07:00
parent fdaa672ad1
commit c9b4f6b502
11 changed files with 737 additions and 202 deletions

View File

@@ -581,6 +581,7 @@ func gatherRequiredDepsForTest() string {
name: "%[1]s-lib",
sdk_version: "none",
system_modules: "none",
srcs: ["a.java"],
}
`, extra)
}
@@ -780,3 +781,5 @@ func FixtureSetBootImageInstallDirOnDevice(name string, installDir string) andro
config.installDir = installDir
})
}
var PrepareForTestWithTransitiveClasspathEnabled = android.PrepareForTestWithBuildFlag("RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH", "true")