summaryrefslogtreecommitdiff
path: root/apex
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2024-09-26 18:18:37 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-09-26 18:18:37 +0000
commitba6b33b58e0ffe59b00920fcd08402e773facda6 (patch)
treea407f7ecd26f407668424cf49312a7d5994cb1c7 /apex
parentd5f6f594decbca469ef6d3e30f7d35d6a42aa64a (diff)
parentff49c6c75d8c2978b4cd7b8a8921de8f2ac4f6a3 (diff)
Merge "Use providers for lint" into main am: ff49c6c75d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3283077 Change-Id: Id311119272fdf4c577a3e8ffa05f6f3c756a1f34 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'apex')
-rw-r--r--apex/apex.go12
-rw-r--r--apex/builder.go4
2 files changed, 10 insertions, 6 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 0caf37ccc..902059543 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -583,7 +583,7 @@ type apexFile struct {
dataPaths []android.DataPath // becomes LOCAL_TEST_DATA
jacocoReportClassesFile android.Path // only for javalibs and apps
- lintDepSets java.LintDepSets // only for javalibs and apps
+ lintInfo *java.LintInfo // only for javalibs and apps
certificate java.Certificate // only for apps
overriddenPackageName string // only for apps
@@ -1662,7 +1662,6 @@ type javaModule interface {
BaseModuleName() string
DexJarBuildPath(ctx android.ModuleErrorfContext) java.OptionalDexJarPath
JacocoReportClassesFile() android.Path
- LintDepSets() java.LintDepSets
Stem() string
}
@@ -1682,7 +1681,9 @@ func apexFileForJavaModuleWithFile(ctx android.ModuleContext, module javaModule,
dirInApex := "javalib"
af := newApexFile(ctx, dexImplementationJar, module.BaseModuleName(), dirInApex, javaSharedLib, module)
af.jacocoReportClassesFile = module.JacocoReportClassesFile()
- af.lintDepSets = module.LintDepSets()
+ if lintInfo, ok := android.OtherModuleProvider(ctx, module, java.LintProvider); ok {
+ af.lintInfo = lintInfo
+ }
af.customStem = module.Stem() + ".jar"
// TODO: b/338641779 - Remove special casing of sdkLibrary once bcpf and sscpf depends
// on the implementation library
@@ -1720,7 +1721,6 @@ type androidApp interface {
JacocoReportClassesFile() android.Path
Certificate() java.Certificate
BaseModuleName() string
- LintDepSets() java.LintDepSets
PrivAppAllowlist() android.OptionalPath
}
@@ -1756,7 +1756,9 @@ func apexFilesForAndroidApp(ctx android.BaseModuleContext, aapp androidApp) []ap
af := newApexFile(ctx, fileToCopy, aapp.BaseModuleName(), dirInApex, app, aapp)
af.jacocoReportClassesFile = aapp.JacocoReportClassesFile()
- af.lintDepSets = aapp.LintDepSets()
+ if lintInfo, ok := android.OtherModuleProvider(ctx, aapp, java.LintProvider); ok {
+ af.lintInfo = lintInfo
+ }
af.certificate = aapp.Certificate()
if app, ok := aapp.(interface {
diff --git a/apex/builder.go b/apex/builder.go
index 19ec1bd46..7334aca92 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -1159,7 +1159,9 @@ func (a *apexBundle) buildApexDependencyInfo(ctx android.ModuleContext) {
func (a *apexBundle) buildLintReports(ctx android.ModuleContext) {
depSetsBuilder := java.NewLintDepSetBuilder()
for _, fi := range a.filesInfo {
- depSetsBuilder.Transitive(fi.lintDepSets)
+ if fi.lintInfo != nil {
+ depSetsBuilder.Transitive(fi.lintInfo)
+ }
}
a.lintReports = java.BuildModuleLintReportZips(ctx, depSetsBuilder.Build())