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 --- sh/sh_binary.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sh/sh_binary.go') diff --git a/sh/sh_binary.go b/sh/sh_binary.go index 2e48d83e6..ac27df820 100644 --- a/sh/sh_binary.go +++ b/sh/sh_binary.go @@ -120,6 +120,16 @@ type TestProperties struct { // the test. Data []string `android:"path,arch_variant"` + // same as data, but adds dependencies using the device's os variation and the common + // architecture's variation. Can be used to add a module built for device to the data of a + // host test. + 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"` + // Add RootTargetPreparer to auto generated test config. This guarantees the test to run // with root permission. Require_root *bool @@ -407,6 +417,8 @@ func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { s.ShBinary.generateAndroidBuildActions(ctx) expandedData := android.PathsForModuleSrc(ctx, s.testProperties.Data) + expandedData = append(expandedData, android.PathsForModuleSrc(ctx, s.testProperties.Device_common_data)...) + expandedData = append(expandedData, android.PathsForModuleSrc(ctx, s.testProperties.Device_first_data)...) // Emulate the data property for java_data dependencies. for _, javaData := range ctx.GetDirectDepsWithTag(shTestJavaDataTag) { expandedData = append(expandedData, android.OutputFilesForModule(ctx, javaData, "")...) -- cgit v1.2.3-59-g8ed1b