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
diff --git a/java/robolectric.go b/java/robolectric.go
index a37a118..a0c9c7f 100644
--- a/java/robolectric.go
+++ b/java/robolectric.go
@@ -83,6 +83,9 @@
testConfig android.Path
data android.Paths
+
+ forceOSType android.OsType
+ forceArchType android.ArchType
}
func (r *robolectricTest) TestSuites() []string {
@@ -115,6 +118,9 @@
}
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 (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 @@
props robolectricRuntimesProperties
runtimes []android.InstallPath
+
+ forceOSType android.OsType
+ forceArchType android.ArchType
}
func (r *robolectricRuntimes) TestSuites() []string {
@@ -385,6 +394,9 @@
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) 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
}