aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJeff Gaston <jeffrygaston@google.com>2017-11-09 17:21:27 -0800
committerJeff Gaston <jeffrygaston@google.com>2017-11-29 13:03:40 -0800
commit63a250a336a1b910836eeb4caebcf5b4f8d91c2a (patch)
tree0a2d675afa44695da725014d710d61e6445e4e35 /cmd
parent53139119121242ed065eac3198ebc5fb4df3dbaf (diff)
downloadbuild_soong-63a250a336a1b910836eeb4caebcf5b4f8d91c2a.tar.gz
build_soong-63a250a336a1b910836eeb4caebcf5b4f8d91c2a.tar.bz2
build_soong-63a250a336a1b910836eeb4caebcf5b4f8d91c2a.zip
Soong support for namespaces
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: I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c
Diffstat (limited to 'cmd')
-rw-r--r--cmd/soong_build/main.go19
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())