Merge "cargo_embargo: add option to set module visibility"
This commit is contained in:
@@ -118,6 +118,7 @@ impl BpProperties {
|
|||||||
"target",
|
"target",
|
||||||
"ld_flags",
|
"ld_flags",
|
||||||
"apex_available",
|
"apex_available",
|
||||||
|
"visibility",
|
||||||
];
|
];
|
||||||
let mut props: Vec<(&String, &BpValue)> = self.map.iter().collect();
|
let mut props: Vec<(&String, &BpValue)> = self.map.iter().collect();
|
||||||
props.sort_by_key(|(k, _)| {
|
props.sort_by_key(|(k, _)| {
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ struct Config {
|
|||||||
/// Modules in this list will not be generated.
|
/// Modules in this list will not be generated.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
module_blocklist: Vec<String>,
|
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
|
/// 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());
|
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 {
|
if let Some(path) = &package_cfg.add_module_block {
|
||||||
let content = std::fs::read_to_string(path)
|
let content = std::fs::read_to_string(path)
|
||||||
.with_context(|| format!("failed to read {path:?}"))?;
|
.with_context(|| format!("failed to read {path:?}"))?;
|
||||||
|
|||||||
Reference in New Issue
Block a user