From 65cb40a975fb53187cfc5d9edea905b1f7630ab2 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Mon, 21 Oct 2024 15:41:42 -0700 Subject: Add new properties to aid in removing the 1-variant fallback These new properties are essentially methods to specify "outgoing transitions" in blueprint files. There are lots of host tests that want to include apps built for device in their data, so they need a property that adds dependencies based on the device variants instead of copying the same host variants. After this cl is submitted, I'll do an LSC to update all the usages that are relying on the 1-variant fallback to use these properties instead. Bug: 372091092 Test: m nothing --no-skip-soong-tests Change-Id: I45b8fb024da120ad61606e3a21de86e4392be2a4 --- java/java.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 288042b42..14e31534d 100644 --- a/java/java.go +++ b/java/java.go @@ -1291,6 +1291,16 @@ 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"` + // 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. @@ -1581,6 +1591,8 @@ 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.extraTestConfigs = android.PathsForModuleSrc(ctx, j.testProperties.Test_options.Extra_test_configs) -- cgit v1.2.3-59-g8ed1b