From a3a05460b478ed59c527dec1c8b2efa61ce9c53c Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Fri, 5 Apr 2024 00:36:44 +0000 Subject: Revert^2 "Remove compilation actions from java sdk library" This change modifies the build actions of java_sdk_library module type so that it does not perform any compilation actions (i.e. does not create the top level java_sdk_library jar file). Instead, it delegates the build actions the top level jar file was performing to the dynamically created ".impl"-suffixed java library module. The build actions that are delegated to the impl library module include hiddenapi processing, dexing, and dexpreopt. This change relands https://r.android.com/3035972. Implementation changes from the original change: - "all_apex_contributions" is added as a dependecy to the implementation library modules where the parent sdk_library module has a prebuilt equivalent. This allows the source apex variant to be hidden from make when the prebuilt is active. Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing Test: m nothing --no-skip-soong-tests Bug: 332785297 Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257 --- apex/apex.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'apex/apex.go') diff --git a/apex/apex.go b/apex/apex.go index cb8449c5a..2e7fbf6ac 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1672,7 +1672,13 @@ func apexFileForJavaModuleWithFile(ctx android.BaseModuleContext, module javaMod af.jacocoReportClassesFile = module.JacocoReportClassesFile() af.lintDepSets = module.LintDepSets() af.customStem = module.Stem() + ".jar" - if dexpreopter, ok := module.(java.DexpreopterInterface); ok { + // TODO: b/338641779 - Remove special casing of sdkLibrary once bcpf and sscpf depends + // on the implementation library + if sdkLib, ok := module.(*java.SdkLibrary); ok { + for _, install := range sdkLib.BuiltInstalledForApex() { + af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName()) + } + } else if dexpreopter, ok := module.(java.DexpreopterInterface); ok { for _, install := range dexpreopter.DexpreoptBuiltInstalledForApex() { af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName()) } -- cgit v1.2.3-59-g8ed1b