From 629e2a3e9ae745474d75306bf5e2b246f5241de6 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Tue, 25 Jun 2024 20:47:49 +0000 Subject: [PATCH] Utilize linter artifacts of the impl library in the top level sdk library When creating the lint reports for the mainline modules, the apex build rule collects the lint artifacts from its dependencies. The artifacts for Java modules are collected using the two methods: - `JacocoReportClassesFile()` - `LintDepSets()` https://r.android.com/3079425 has removed the compilation actions from the top level sdk library, but given that BCPF and SSCPF still list the top level sdk library as the dependency, the lint artifacts are collected from the top level sdk library. The aforementioned change resolved this discrepancy by the top level sdk library referencing the build artifacts of the implementation library. However, `LintDepSet()` was mistakenly left out, leading to the lint xml file of the sdk library not being correctly included in the apex lint artifacts. This change fixes such discrepancy by the top level sdk library correctly referencing the lint dep set output of the implementation library. Bug: 339267677 Test: TARGET_RELEASE=ap3a TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86_64 MODULE_RELEASED_PLATFORM=U COVERAGE_MODULES="configinfrastructure" ./vendor/google/build/build_unbundled_coverage_mainline_module.sh \ inspect ninja command and verify that the lint xml files of the impl lib is included in com.android.configinfrastructure module lint-report-xml.zip Change-Id: I5c397c8782bad3bc21524f9ef7991cfdda4cdda1 --- java/sdk_library.go | 1 + 1 file changed, 1 insertion(+) diff --git a/java/sdk_library.go b/java/sdk_library.go index c19b07bb6..82f6cb5a9 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -1679,6 +1679,7 @@ func (module *SdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) module.dexer.proguardDictionary = module.implLibraryModule.dexer.proguardDictionary module.dexer.proguardUsageZip = module.implLibraryModule.dexer.proguardUsageZip module.linter.reports = module.implLibraryModule.linter.reports + module.linter.outputs.depSets = module.implLibraryModule.LintDepSets() if !module.Host() { module.hostdexInstallFile = module.implLibraryModule.hostdexInstallFile