summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go29
1 files changed, 12 insertions, 17 deletions
diff --git a/java/java.go b/java/java.go
index dd0418894..2236d05b2 100644
--- a/java/java.go
+++ b/java/java.go
@@ -27,6 +27,7 @@ import (
"android/soong/bazel"
"android/soong/bazel/cquery"
"android/soong/remoteexec"
+ "android/soong/testing"
"android/soong/ui/metrics/bp2build_metrics_proto"
"github.com/google/blueprint"
@@ -296,15 +297,6 @@ type JavaInfo struct {
// JacocoReportClassesFile is the path to a jar containing uninstrumented classes that will be
// instrumented by jacoco.
JacocoReportClassesFile android.Path
-
- // set of aconfig flags for all transitive libs deps
- // TODO(joeo): It would be nice if this were over in the aconfig package instead of here.
- // In order to do that, generated_java_library would need a way doing
- // collectTransitiveAconfigFiles with one of the callbacks, and having that automatically
- // propagated. If we were to clean up more of the stuff on JavaInfo that's not part of
- // core java rules (e.g. AidlIncludeDirs), then maybe adding more framework to do that would be
- // worth it.
- TransitiveAconfigFiles *android.DepSet[android.Path]
}
var JavaInfoProvider = blueprint.NewProvider(JavaInfo{})
@@ -638,9 +630,9 @@ func normalizeJavaVersion(ctx android.BaseModuleContext, javaVersion string) jav
type Library struct {
Module
- exportedProguardFlagFiles android.Paths
+ combinedExportedProguardFlagsFile android.Path
- InstallMixin func(ctx android.ModuleContext, installPath android.Path) (extraInstallDeps android.Paths)
+ InstallMixin func(ctx android.ModuleContext, installPath android.Path) (extraInstallDeps android.InstallPaths)
}
var _ android.ApexModule = (*Library)(nil)
@@ -699,8 +691,12 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
proguardSpecInfo := j.collectProguardSpecInfo(ctx)
ctx.SetProvider(ProguardSpecInfoProvider, proguardSpecInfo)
- j.exportedProguardFlagFiles = proguardSpecInfo.ProguardFlagsFiles.ToList()
- j.extraProguardFlagFiles = append(j.extraProguardFlagFiles, j.exportedProguardFlagFiles...)
+ exportedProguardFlagsFiles := proguardSpecInfo.ProguardFlagsFiles.ToList()
+ j.extraProguardFlagsFiles = append(j.extraProguardFlagsFiles, exportedProguardFlagsFiles...)
+
+ combinedExportedProguardFlagFile := android.PathForModuleOut(ctx, "export_proguard_flags")
+ writeCombinedProguardFlagsFile(ctx, combinedExportedProguardFlagFile, exportedProguardFlagsFiles)
+ j.combinedExportedProguardFlagsFile = combinedExportedProguardFlagFile
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
if !apexInfo.IsForPlatform() {
@@ -719,12 +715,9 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
j.compile(ctx, nil, nil, nil)
- // Collect the module directory for IDE info in java/jdeps.go.
- j.modulePaths = append(j.modulePaths, ctx.ModuleDir())
-
exclusivelyForApex := !apexInfo.IsForPlatform()
if (Bool(j.properties.Installable) || ctx.Host()) && !exclusivelyForApex {
- var extraInstallDeps android.Paths
+ var extraInstallDeps android.InstallPaths
if j.InstallMixin != nil {
extraInstallDeps = j.InstallMixin(ctx, j.outputFile)
}
@@ -1228,10 +1221,12 @@ func (j *TestHost) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
j.Test.generateAndroidBuildActionsWithConfig(ctx, configs)
+ ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
}
func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) {
j.generateAndroidBuildActionsWithConfig(ctx, nil)
+ ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
}
func (j *Test) generateAndroidBuildActionsWithConfig(ctx android.ModuleContext, configs []tradefed.Config) {