Allow //visibility:public to override other visibility rules.
However only allow it when they are merged from different defaults. Extend the tests to cover that and other cases with visibilities in defaults. Also avoid dumping the whole visibility spec in the error message when a visibility check fails, because it gets noisy for long visibility lists, and can be confusing when //visibility:public gets merged with other visibility rules. Test: Soong self test Bug: 112158820 Bug: 130796911 Change-Id: I242513975a3f824b9ea2eab5b94b194b9af2481b
This commit is contained in:
@@ -195,8 +195,10 @@ where `//project` is the module's package. e.g. using `[":__subpackages__"]` in
|
||||
* `["//visibility:legacy_public"]`: The default visibility, behaves as
|
||||
`//visibility:public` for now. It is an error if it is used in a module.
|
||||
|
||||
The visibility rules of `//visibility:public` and `//visibility:private` can
|
||||
not be combined with any other visibility specifications.
|
||||
The visibility rules of `//visibility:public` and `//visibility:private` can not
|
||||
be combined with any other visibility specifications, except
|
||||
`//visibility:public` is allowed to override visibility specifications imported
|
||||
through the `defaults` property.
|
||||
|
||||
Packages outside `vendor/` cannot make themselves visible to specific packages
|
||||
in `vendor/`, e.g. a module in `libcore` cannot declare that it is visible to
|
||||
|
Reference in New Issue
Block a user