Move checkbuild targets of Soong modules into Soong
Pass the name of Soong's checkbuild target for each module to
Make so that it can depend on it from the main checkbuild rule.
This will give better control over which files get built, allowing
checkbuild to skip the jar combining step when transitive classpath
jars are enabled. The per-module checkbuild targets are passed to
make instead of added directly as a dependency of checkbuild in order
to maintain the existing behavior of only building modules exposed
to make in checkbuild.
Also tweak the existing calls to CheckbuildFile and add
InstallFileWithoutCheckbuild to match the files that are
in the Make-based checkbuild.
Bug: 308016794
Test: m checkbuild
Change-Id: Ic5140819381d58f4d00f23a7a12447950c4cf268
diff --git a/java/aar.go b/java/aar.go
index 1bd372f..db2ea66 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -403,6 +403,7 @@
packageName: a.manifestValues.applicationId,
}
a.mergedManifestFile = manifestMerger(ctx, transitiveManifestPaths[0], manifestMergerParams)
+ ctx.CheckbuildFile(a.mergedManifestFile)
if !a.isLibrary {
// Only use the merged manifest for applications. For libraries, the transitive closure of manifests
// will be propagated to the final application and merged there. The merged manifest for libraries is
@@ -537,6 +538,8 @@
aapt2Link(ctx, packageRes, srcJar, proguardOptionsFile, rTxt,
linkFlags, linkDeps, compiledRes, compiledOverlay, transitiveAssets, splitPackages,
opts.aconfigTextFiles)
+ ctx.CheckbuildFile(packageRes)
+
// Extract assets from the resource package output so that they can be used later in aapt2link
// for modules that depend on this one.
if android.PrefixInList(linkFlags, "-A ") {
@@ -887,7 +890,6 @@
var res android.Paths
if a.androidLibraryProperties.BuildAAR {
BuildAAR(ctx, a.aarFile, a.outputFile, a.manifestPath, a.rTxt, res)
- ctx.CheckbuildFile(a.aarFile)
}
prebuiltJniPackages := android.Paths{}
@@ -1252,10 +1254,12 @@
transitiveAssets := android.ReverseSliceInPlace(staticDeps.assets())
aapt2Link(ctx, exportPackage, nil, proguardOptionsFile, aaptRTxt,
linkFlags, linkDeps, nil, overlayRes, transitiveAssets, nil, nil)
+ ctx.CheckbuildFile(exportPackage)
a.exportPackage = exportPackage
rJar := android.PathForModuleOut(ctx, "busybox/R.jar")
resourceProcessorBusyBoxGenerateBinaryR(ctx, a.rTxt, a.manifest, rJar, nil, true, nil, false)
+ ctx.CheckbuildFile(rJar)
a.rJar = rJar
aapt2ExtractExtraPackages(ctx, extraAaptPackagesFile, a.rJar)
@@ -1350,6 +1354,9 @@
a.headerJarFile = classpathFile
}
+ ctx.CheckbuildFile(a.headerJarFile)
+ ctx.CheckbuildFile(a.implementationJarFile)
+
android.SetProvider(ctx, JavaInfoProvider, &JavaInfo{
HeaderJars: android.PathsIfNonNil(a.headerJarFile),
ResourceJars: android.PathsIfNonNil(resourceJarFile),