diff options
author | 2025-03-18 23:23:44 +0000 | |
---|---|---|
committer | 2025-03-19 17:14:31 +0000 | |
commit | fb4b996aa0d358326a9c105cc55735e66b8aa5b2 (patch) | |
tree | 6ef28a871478b864c558fc5b220d2002e5471f87 | |
parent | be6f81d61e25753eeecdb65bdf7dd2bb6d4c1a5c (diff) |
Add SupportFilesInfo provider
This provider will be used to collect the
SOONG_INSTALLED_COMPATIBILITY_SUPPORT_FILES in device-tests mk code.
Test: CI
Bug: 388850000
Change-Id: I0e9d758eb83e289a806872f91515c5e5674cd4d0
-rw-r--r-- | android/test_suites.go | 6 | ||||
-rw-r--r-- | tradefed_modules/test_module_config.go | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/android/test_suites.go b/android/test_suites.go index 9eaf78549..dbcd48c79 100644 --- a/android/test_suites.go +++ b/android/test_suites.go @@ -42,6 +42,12 @@ type TestSuiteInfo struct { var TestSuiteInfoProvider = blueprint.NewProvider[TestSuiteInfo]() +type SupportFilesInfo struct { + SupportFiles InstallPaths +} + +var SupportFilesInfoProvider = blueprint.NewProvider[SupportFilesInfo]() + func (t *testSuiteFiles) GenerateBuildActions(ctx SingletonContext) { files := make(map[string]map[string]InstallPaths) diff --git a/tradefed_modules/test_module_config.go b/tradefed_modules/test_module_config.go index 2b341288a..e833df293 100644 --- a/tradefed_modules/test_module_config.go +++ b/tradefed_modules/test_module_config.go @@ -1,14 +1,15 @@ package tradefed_modules import ( - "android/soong/android" - "android/soong/tradefed" "encoding/json" "fmt" "io" "slices" "strings" + "android/soong/android" + "android/soong/tradefed" + "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -178,6 +179,10 @@ func (m *testModuleConfigModule) GenerateAndroidBuildActions(ctx android.ModuleC moduleInfoJSON.TestConfig = []string{m.testConfig.String()} moduleInfoJSON.AutoTestConfig = []string{"true"} moduleInfoJSON.TestModuleConfigBase = proptools.String(m.Base) + + android.SetProvider(ctx, android.SupportFilesInfoProvider, android.SupportFilesInfo{ + SupportFiles: m.supportFiles, + }) } // Ensure at least one test_suite is listed. Ideally it should be general-tests @@ -327,6 +332,9 @@ func (m *testModuleConfigHostModule) DepsMutator(ctx android.BottomUpMutatorCont func (m *testModuleConfigHostModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { m.validateBase(ctx, &testModuleConfigHostTag, "java_test_host", true) m.generateManifestAndConfig(ctx) + android.SetProvider(ctx, android.SupportFilesInfoProvider, android.SupportFilesInfo{ + SupportFiles: m.supportFiles, + }) } // Ensure the base listed is the right type by checking that we get the expected provider data. |