aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJeff Gaston <jeffrygaston@google.com>2017-11-29 23:01:39 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-11-29 23:01:39 +0000
commita8063afc16ff3cdd88aa110f09d8ca1884d1e514 (patch)
treedb104595fe170c3797fb6d231c8bd9f42b58743d /cmd
parentb8160761f7ddc71d2ecf3a35edae15ff6d0fc84c (diff)
parent63a250a336a1b910836eeb4caebcf5b4f8d91c2a (diff)
downloadbuild_soong-a8063afc16ff3cdd88aa110f09d8ca1884d1e514.tar.gz
build_soong-a8063afc16ff3cdd88aa110f09d8ca1884d1e514.tar.bz2
build_soong-a8063afc16ff3cdd88aa110f09d8ca1884d1e514.zip
Merge "Soong support for namespaces"
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())