Merge "Reduce modules exposed to Make in Mac builds"

This commit is contained in:
Dan Willemsen
2021-10-19 00:32:54 +00:00
committed by Gerrit Code Review
6 changed files with 72 additions and 9 deletions

View File

@@ -29,6 +29,7 @@ import (
"os"
"path/filepath"
"reflect"
"runtime"
"sort"
"strings"
@@ -902,6 +903,13 @@ func shouldSkipAndroidMkProcessing(module *ModuleBase) bool {
return true
}
// On Mac, only expose host darwin modules to Make, as that's all we claim to support.
// In reality, some of them depend on device-built (Java) modules, so we can't disable all
// device modules in Soong, but we can hide them from Make (and thus the build user interface)
if runtime.GOOS == "darwin" && module.Os() != Darwin {
return true
}
return !module.Enabled() ||
module.commonProperties.HideFromMake ||
// Make does not understand LinuxBionic

View File

@@ -18,6 +18,7 @@ import (
"fmt"
"io"
"reflect"
"runtime"
"strings"
"testing"
@@ -155,6 +156,11 @@ func buildContextAndCustomModuleFoo(t *testing.T, bp string) (*TestContext, *cus
}
func TestAndroidMkSingleton_PassesUpdatedAndroidMkDataToCustomCallback(t *testing.T) {
if runtime.GOOS == "darwin" {
// Device modules are not exported on Mac, so this test doesn't work.
t.SkipNow()
}
bp := `
custom {
name: "foo",