summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2024-03-05 00:36:31 +0000
committer Yu Liu <yudiliu@google.com> 2024-03-07 18:51:16 +0000
commit67a28425a7bb337038826cc1e59a9e42d4ae65a1 (patch)
tree7c189e0ab7f28c7174d2ef12dd9ddaca1c2e3b90 /java/java.go
parenteefca7373c1cefc2ee14a3b6a86db7eeefcddfbe (diff)
Validate aconfig libs are built with the correct modes.
Bug: 323071835 Test: Unit tests and manual tests. Change-Id: I32de90826c7c8bb4d8495608e959d554820ab9a2
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/java/java.go b/java/java.go
index 794020dc5..4b996724a 100644
--- a/java/java.go
+++ b/java/java.go
@@ -24,7 +24,6 @@ import (
"sort"
"strings"
- "android/soong/aconfig"
"android/soong/remoteexec"
"android/soong/testing"
@@ -346,6 +345,12 @@ func (j *Module) XrefJavaFiles() android.Paths {
return j.kytheFiles
}
+func (d dependencyTag) PropagateAconfigValidation() bool {
+ return d.static
+}
+
+var _ android.PropagateAconfigValidationDependencyTag = dependencyTag{}
+
type dependencyTag struct {
blueprint.BaseDependencyTag
name string
@@ -355,6 +360,8 @@ type dependencyTag struct {
// True if the dependency is a toolchain, for example an annotation processor.
toolchain bool
+
+ static bool
}
// installDependencyTag is a dependency tag that is annotated to cause the installed files of the
@@ -400,7 +407,7 @@ func IsJniDepTag(depTag blueprint.DependencyTag) bool {
var (
dataNativeBinsTag = dependencyTag{name: "dataNativeBins"}
dataDeviceBinsTag = dependencyTag{name: "dataDeviceBins"}
- staticLibTag = dependencyTag{name: "staticlib"}
+ staticLibTag = dependencyTag{name: "staticlib", static: true}
libTag = dependencyTag{name: "javalib", runtimeLinked: true}
sdkLibTag = dependencyTag{name: "sdklib", runtimeLinked: true}
java9LibTag = dependencyTag{name: "java9lib", runtimeLinked: true}
@@ -2172,7 +2179,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
case aconfigDeclarationTag:
if provider, ok := android.OtherModuleProvider(ctx, dep, android.AconfigDeclarationsProviderKey); ok {
al.aconfigProtoFiles = append(al.aconfigProtoFiles, provider.IntermediateCacheOutputPath)
- } else if provider, ok := android.OtherModuleProvider(ctx, dep, aconfig.CodegenInfoProvider); ok {
+ } else if provider, ok := android.OtherModuleProvider(ctx, dep, android.CodegenInfoProvider); ok {
al.aconfigProtoFiles = append(al.aconfigProtoFiles, provider.IntermediateCacheOutputPaths...)
} else {
ctx.ModuleErrorf("Only aconfig_declarations and aconfig_declarations_group "+