aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorPatrice Arruda <patricearruda@google.com>2019-03-27 09:06:33 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-03-27 09:06:33 -0700
commit010bc3f077e148ac54b84c153ed881e289bfff18 (patch)
treee059183ae62a2cc60474ef7be3b10b2ace88f643 /android
parenta97234fc3a7a79fa2a2c054846665bc4fdd564bd (diff)
parente54b65abc2ac718f3972d625279fd80df881beb2 (diff)
downloadbuild_soong-010bc3f077e148ac54b84c153ed881e289bfff18.tar.gz
build_soong-010bc3f077e148ac54b84c153ed881e289bfff18.tar.bz2
build_soong-010bc3f077e148ac54b84c153ed881e289bfff18.zip
Merge "Soong: Add synopsis to soong_namespace module." am: 39302bbcb9 am: acca92e981
am: e54b65abc2 Change-Id: I3b2de8d90dff9a398588cf0e2677e57ba05dfb12
Diffstat (limited to 'android')
-rw-r--r--android/namespace.go20
1 files changed, 17 insertions, 3 deletions
diff --git a/android/namespace.go b/android/namespace.go
index dca2b8c9..50bdcba7 100644
--- a/android/namespace.go
+++ b/android/namespace.go
@@ -355,15 +355,19 @@ func NewNamespace(path string) *Namespace {
var _ blueprint.Namespace = (*Namespace)(nil)
+type namespaceProperties struct {
+ // a list of namespaces that contain modules that will be referenced
+ // by modules in this namespace.
+ Imports []string `android:"path"`
+}
+
type NamespaceModule struct {
ModuleBase
namespace *Namespace
resolver *NameResolver
- properties struct {
- Imports []string
- }
+ properties namespaceProperties
}
func (n *NamespaceModule) GenerateAndroidBuildActions(ctx ModuleContext) {
@@ -376,6 +380,16 @@ func (n *NamespaceModule) Name() (name string) {
return *n.nameProperties.Name
}
+// soong_namespace provides a scope to modules in an Android.bp file to prevent
+// module name conflicts with other defined modules in different Android.bp
+// files. Once soong_namespace has been defined in an Android.bp file, the
+// namespacing is applied to all modules that follow the soong_namespace in
+// the current Android.bp file, as well as modules defined in Android.bp files
+// in subdirectories. An Android.bp file in a subdirectory can define its own
+// soong_namespace which is applied to all its modules and as well as modules
+// defined in subdirectories Android.bp files. Modules in a soong_namespace are
+// visible to Make by listing the namespace path in PRODUCT_SOONG_NAMESPACES
+// make variable in a makefile.
func NamespaceFactory() Module {
module := &NamespaceModule{}