Merge "cargo_embargo: add option to set module visibility"
This commit is contained in:
@@ -118,6 +118,7 @@ impl BpProperties {
|
||||
"target",
|
||||
"ld_flags",
|
||||
"apex_available",
|
||||
"visibility",
|
||||
];
|
||||
let mut props: Vec<(&String, &BpValue)> = self.map.iter().collect();
|
||||
props.sort_by_key(|(k, _)| {
|
||||
|
||||
@@ -103,6 +103,9 @@ struct Config {
|
||||
/// Modules in this list will not be generated.
|
||||
#[serde(default)]
|
||||
module_blocklist: Vec<String>,
|
||||
/// Modules name => Soong "visibility" property.
|
||||
#[serde(default)]
|
||||
module_visibility: BTreeMap<String, Vec<String>>,
|
||||
}
|
||||
|
||||
/// Options that apply to everything in a package (i.e. everything associated with a particular
|
||||
@@ -569,6 +572,10 @@ fn crate_to_bp_modules(
|
||||
m.props.set("apex_available", cfg.apex_available.clone());
|
||||
}
|
||||
|
||||
if let Some(visibility) = cfg.module_visibility.get(module_name) {
|
||||
m.props.set("visibility", visibility.clone());
|
||||
}
|
||||
|
||||
if let Some(path) = &package_cfg.add_module_block {
|
||||
let content = std::fs::read_to_string(path)
|
||||
.with_context(|| format!("failed to read {path:?}"))?;
|
||||
|
||||
Reference in New Issue
Block a user