Replace android.BuildOs with Config.BuildOS

Replace the android.BuildOs constant with Config.BuildOS so that it
can vary based on the product config.

Bug: 190084016
Test: all Soong tests
Change-Id: Ia67f872d8b2ab788747a22e3a9659dc21c9775cd
This commit is contained in:
Colin Cross
2021-07-20 09:47:41 -07:00
parent ae86338676
commit 0c66bc615b
22 changed files with 457 additions and 421 deletions

View File

@@ -83,6 +83,9 @@ type robolectricTest struct {
testConfig android.Path
data android.Paths
forceOSType android.OsType
forceArchType android.ArchType
}
func (r *robolectricTest) TestSuites() []string {
@@ -115,6 +118,9 @@ func (r *robolectricTest) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (r *robolectricTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
r.forceOSType = ctx.Config().BuildOS
r.forceArchType = ctx.Config().BuildArch
r.testConfig = tradefed.AutoGenRobolectricTestConfig(ctx, r.testProperties.Test_config,
r.testProperties.Test_config_template, r.testProperties.Test_suites,
r.testProperties.Auto_gen_config)
@@ -345,7 +351,7 @@ func RobolectricTestFactory() android.Module {
func (r *robolectricTest) InstallBypassMake() bool { return true }
func (r *robolectricTest) InstallInTestcases() bool { return true }
func (r *robolectricTest) InstallForceOS() (*android.OsType, *android.ArchType) {
return &android.BuildOs, &android.BuildArch
return &r.forceOSType, &r.forceArchType
}
func robolectricRuntimesFactory() android.Module {
@@ -366,6 +372,9 @@ type robolectricRuntimes struct {
props robolectricRuntimesProperties
runtimes []android.InstallPath
forceOSType android.OsType
forceArchType android.ArchType
}
func (r *robolectricRuntimes) TestSuites() []string {
@@ -385,6 +394,9 @@ func (r *robolectricRuntimes) GenerateAndroidBuildActions(ctx android.ModuleCont
return
}
r.forceOSType = ctx.Config().BuildOS
r.forceArchType = ctx.Config().BuildArch
files := android.PathsForModuleSrc(ctx, r.props.Jars)
androidAllDir := android.PathForModuleInstall(ctx, "android-all")
@@ -417,5 +429,5 @@ func (r *robolectricRuntimes) GenerateAndroidBuildActions(ctx android.ModuleCont
func (r *robolectricRuntimes) InstallBypassMake() bool { return true }
func (r *robolectricRuntimes) InstallInTestcases() bool { return true }
func (r *robolectricRuntimes) InstallForceOS() (*android.OsType, *android.ArchType) {
return &android.BuildOs, &android.BuildArch
return &r.forceOSType, &r.forceArchType
}