Add device_first_prefer32_data to java modules
Some java host tests add data dependencies on
`compile_multilib: "first_prefer32"` modules. In order to match that
with the requested variations, add a device_first_prefer32_data
property.
Bug: 372091092
Test: m nothing
Change-Id: I54d056cc864512b22ad3da882c807052344ac1ca
diff --git a/java/app.go b/java/app.go
index 56fcfbb..addbc28 100644
--- a/java/app.go
+++ b/java/app.go
@@ -1442,6 +1442,7 @@
a.data = android.PathsForModuleSrc(ctx, a.testProperties.Data)
a.data = append(a.data, android.PathsForModuleSrc(ctx, a.testProperties.Device_common_data)...)
a.data = append(a.data, android.PathsForModuleSrc(ctx, a.testProperties.Device_first_data)...)
+ a.data = append(a.data, android.PathsForModuleSrc(ctx, a.testProperties.Device_first_prefer32_data)...)
android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{})
android.SetProvider(ctx, tradefed.BaseTestProviderKey, tradefed.BaseTestProviderData{
InstalledFiles: a.data,
diff --git a/java/java.go b/java/java.go
index 5bb3636..6797148 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1301,6 +1301,12 @@
// host test.
Device_first_data []string `android:"path_device_first"`
+ // same as data, but adds dependencies using the device's os variation and the device's first
+ // 32-bit architecture's variation. If a 32-bit arch doesn't exist for this device, it will use
+ // a 64 bit arch instead. Can be used to add a module built for device to the data of a
+ // host test.
+ Device_first_prefer32_data []string `android:"path_device_first_prefer32"`
+
// Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
// doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
// explicitly.
@@ -1593,6 +1599,7 @@
j.data = android.PathsForModuleSrc(ctx, j.testProperties.Data)
j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_common_data)...)
j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_first_data)...)
+ j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_first_prefer32_data)...)
j.extraTestConfigs = android.PathsForModuleSrc(ctx, j.testProperties.Test_options.Extra_test_configs)
diff --git a/java/robolectric.go b/java/robolectric.go
index fb820ef..e6f80ac 100644
--- a/java/robolectric.go
+++ b/java/robolectric.go
@@ -151,6 +151,7 @@
r.data = android.PathsForModuleSrc(ctx, r.testProperties.Data)
r.data = append(r.data, android.PathsForModuleSrc(ctx, r.testProperties.Device_common_data)...)
r.data = append(r.data, android.PathsForModuleSrc(ctx, r.testProperties.Device_first_data)...)
+ r.data = append(r.data, android.PathsForModuleSrc(ctx, r.testProperties.Device_first_prefer32_data)...)
var ok bool
var instrumentedApp *AndroidApp