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

@@ -176,6 +176,8 @@ func TestProjectJsonBinary(t *testing.T) {
}
func TestProjectJsonBindGen(t *testing.T) {
buildOS := android.TestConfig(t.TempDir(), nil, "", nil).BuildOS
bp := `
rust_library {
name: "libd",
@@ -214,9 +216,9 @@ func TestProjectJsonBindGen(t *testing.T) {
if strings.Contains(rootModule, "libbindings1") && !strings.Contains(rootModule, "android_arm64") {
t.Errorf("The source path for libbindings1 does not contain android_arm64, got %v", rootModule)
}
if strings.Contains(rootModule, "libbindings2") && !strings.Contains(rootModule, android.BuildOs.String()) {
if strings.Contains(rootModule, "libbindings2") && !strings.Contains(rootModule, buildOS.String()) {
t.Errorf("The source path for libbindings2 does not contain the BuildOs, got %v; want %v",
rootModule, android.BuildOs.String())
rootModule, buildOS.String())
}
// Check that libbindings1 does not depend on itself.
if strings.Contains(rootModule, "libbindings1") {