summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2019-06-20 16:38:08 +0100
committer Paul Duffin <paulduffin@google.com> 2019-06-27 13:24:59 +0100
commite484f47a639b1afa01e4342e4b2d894f94571d1b (patch)
tree5aee4fe315a1d05dd15371f96d53735ec309b6eb /README.md
parente2453c705f9f49b72d5bf1caded4b979a1bae00d (diff)
Inherit default_visibility from parent package
Enhances the visibility mechanism to use the default_visibility property of the closest ancestor package that has the property specified. Bug: 133290645 Test: m droid Change-Id: I7248e9034a73894ac8d514f913316438c4d7c079
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 8 insertions, 4 deletions
diff --git a/README.md b/README.md
index 51bd9e49c..ebbe8bc50 100644
--- a/README.md
+++ b/README.md
@@ -142,9 +142,9 @@ Unlike most module type `package` does not have a `name` property. Instead the n
name of the package, e.g. if the package is in `top/intermediate/package` then the package name is
`//top/intermediate/package`.
-E.g. The following will set the default visibility for all the modules defined in the package
-(irrespective of whether they are in the same `.bp` file as the `package` module) to be visible to
-all the subpackages by default.
+E.g. The following will set the default visibility for all the modules defined in the package and
+any subpackages that do not set their own default visibility (irrespective of whether they are in
+the same `.bp` file as the `package` module) to be visible to all the subpackages by default.
```
package {
@@ -230,7 +230,11 @@ If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
-the module uses `//visibility:legacy_public`.
+it will use the `default_visibility` of its closest ancestor package for which
+a `default_visibility` property is specified.
+
+If no `default_visibility` property can be found then the module uses the
+global default of `//visibility:legacy_public`.
Once the build has been completely switched over to soong it is possible that a
global refactoring will be done to change this to `//visibility:private` at