diff options
author | Jeff Gaston <jeffrygaston@google.com> | 2017-11-29 16:47:17 -0800 |
---|---|---|
committer | Jeff Gaston <jeffrygaston@google.com> | 2017-12-04 17:44:29 -0800 |
commit | 088e29ed38757e288ad26c7365e3eb6ee92a6f35 (patch) | |
tree | 1ae73ad0fd698fe5978733e98093e1fcceb54dee /cmd | |
parent | 7154928c93e062775c1d3885ed59a5b61c48e168 (diff) | |
download | build_soong-088e29ed38757e288ad26c7365e3eb6ee92a6f35.tar.gz build_soong-088e29ed38757e288ad26c7365e3eb6ee92a6f35.tar.bz2 build_soong-088e29ed38757e288ad26c7365e3eb6ee92a6f35.zip |
Revert "Revert "Soong support for namespaces""
This mostly reverts commit 178d5fefc0cea9d0f031c0bdee125b9d960f32c3
and mostly reapplies change I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c .
Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
--products=aosp_arm \
'build/blueprint:work^ build/soong:work^' \
'build/blueprint:work build/soong:work'
# and see that the only changes were:
# 1. adding some new files
# 2. changing some line numbers
Test: m -j nothing # which runs unit tests
Change-Id: I32baae00277a547fdcdd1c2219fe6625ee0e45d7
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/soong_build/main.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go index e15a6bdd..ddde1c59 100644 --- a/cmd/soong_build/main.go +++ b/cmd/soong_build/main.go @@ -25,6 +25,22 @@ import ( "android/soong/android" ) +func newNameResolver(config android.Config) *android.NameResolver { + namespacePathsToExport := make(map[string]bool) + + for _, namespaceName := range config.ProductVariables.NamespacesToExport { + namespacePathsToExport[namespaceName] = true + } + + namespacePathsToExport["."] = true // always export the root namespace + + exportFilter := func(namespace *android.Namespace) bool { + return namespacePathsToExport[namespace.Path] + } + + return android.NewNameResolver(exportFilter) +} + func main() { flag.Parse() @@ -40,8 +56,7 @@ func main() { os.Exit(1) } - // Temporary hack - //ctx.SetIgnoreUnknownModuleTypes(true) + ctx.SetNameInterface(newNameResolver(configuration)) ctx.SetAllowMissingDependencies(configuration.AllowMissingDependencies()) |