summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go22
1 files changed, 19 insertions, 3 deletions
diff --git a/java/java.go b/java/java.go
index 083648dff..f8b781df3 100644
--- a/java/java.go
+++ b/java/java.go
@@ -26,7 +26,6 @@ import (
"strings"
"android/soong/remoteexec"
- "android/soong/testing"
"github.com/google/blueprint"
"github.com/google/blueprint/depset"
@@ -1292,6 +1291,22 @@ type testProperties struct {
// the test
Data []string `android:"path"`
+ // Same as data, but will add dependencies on modules using the device's os variation and
+ // the common arch variation. Useful for a host test that wants to embed a module built for
+ // device.
+ Device_common_data []string `android:"path_device_common"`
+
+ // same as data, but adds dependencies using the device's os variation and the device's first
+ // architecture's variation. Can be used to add a module built for device to the data of a
+ // 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.
@@ -1542,7 +1557,6 @@ func (j *TestHost) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
j.Test.generateAndroidBuildActionsWithConfig(ctx, configs)
- android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{})
android.SetProvider(ctx, tradefed.BaseTestProviderKey, tradefed.BaseTestProviderData{
InstalledFiles: j.data,
OutputFile: j.outputFile,
@@ -1558,7 +1572,6 @@ func (j *TestHost) GenerateAndroidBuildActions(ctx android.ModuleContext) {
func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) {
checkMinSdkVersionMts(ctx, j.MinSdkVersion(ctx))
j.generateAndroidBuildActionsWithConfig(ctx, nil)
- android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{})
}
func (j *Test) generateAndroidBuildActionsWithConfig(ctx android.ModuleContext, configs []tradefed.Config) {
@@ -1582,6 +1595,9 @@ func (j *Test) generateAndroidBuildActionsWithConfig(ctx android.ModuleContext,
})
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)