summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-10-08 16:39:56 -0700
committer Cole Faust <colefaust@google.com> 2024-10-09 23:08:54 -0700
commitb9c67e21ac0b240af8219d881f95860969a695c8 (patch)
tree7341b6c1d6df824faa1dd96d625d8ac97b1f499b /java/java_test.go
parent8b8b83e42f3fd3886a4bfc91c22a7030a82bc03f (diff)
Make java binaries common instead of common-first
Previously, java binaries had both common and the first arch variants. This was origionally added in aosp/556843. The reasoning there was so that a java binary could be used as the dependency of a genrule. However, now with transition mutators, we can make the incoming transition redirect the arch variant to the common variant if the module only has a common variant. This allows genrules to depend on the common arch variant easily. That change is also included in this cl. Bug: 372091092 Test: m nothing --no-skip-soong-tests Change-Id: Iea612d050bff608d661f81566884653239015213
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 24dabdb10..51cfdabb0 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -569,8 +569,7 @@ func TestBinary(t *testing.T) {
bar := ctx.ModuleForTests("bar", buildOS+"_common")
barJar := bar.Output("bar.jar").Output.String()
- barWrapper := ctx.ModuleForTests("bar", buildOS+"_x86_64")
- barWrapperDeps := barWrapper.Output("bar").Implicits.Strings()
+ barWrapperDeps := bar.Output("bar").Implicits.Strings()
libjni := ctx.ModuleForTests("libjni", buildOS+"_x86_64_shared")
libjniSO := libjni.Rule("Cp").Output.String()
@@ -1931,7 +1930,7 @@ func TestDeviceBinaryWrapperGeneration(t *testing.T) {
main_class: "foo.bar.jb",
}
`)
- wrapperPath := fmt.Sprint(ctx.ModuleForTests("foo", "android_arm64_armv8-a").AllOutputs())
+ wrapperPath := fmt.Sprint(ctx.ModuleForTests("foo", "android_common").AllOutputs())
if !strings.Contains(wrapperPath, "foo.sh") {
t.Errorf("wrapper file foo.sh is not generated")
}
@@ -3125,13 +3124,6 @@ cc_library_shared {
}
`
res, _ := testJava(t, bp)
- // The first variant installs the native library via the common variant, so check the deps of both variants.
- nativeVariantDepsWithDups := findDepsOfModule(res, res.ModuleForTests("myjavabin", "android_arm64_armv8-a").Module(), "mynativelib")
- nativeVariantDepsWithDups = append(nativeVariantDepsWithDups, findDepsOfModule(res, res.ModuleForTests("myjavabin", "android_common").Module(), "mynativelib")...)
-
- nativeVariantDepsUnique := map[blueprint.Module]bool{}
- for _, dep := range nativeVariantDepsWithDups {
- nativeVariantDepsUnique[dep] = true
- }
- android.AssertIntEquals(t, "Create a dep on the first variant", 1, len(nativeVariantDepsUnique))
+ deps := findDepsOfModule(res, res.ModuleForTests("myjavabin", "android_common").Module(), "mynativelib")
+ android.AssertIntEquals(t, "Create a dep on the first variant", 1, len(deps))
}