feat(doom): add doom.aot option (#1214)
This commit is contained in:
@@ -382,6 +382,12 @@
|
||||
# (default: false)
|
||||
# include_release_notes = false
|
||||
|
||||
[doom]
|
||||
# If this is set to true, the `--aot` flag is added to `doom upgrade`,
|
||||
# which enables ahead-of-time native compilation of packages.
|
||||
# (default: false)
|
||||
# aot = true
|
||||
|
||||
[rustup]
|
||||
# If set, updates only these channels.
|
||||
# (default: [] (all channels))
|
||||
|
||||
@@ -391,6 +391,12 @@ pub struct VscodeConfig {
|
||||
profile: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Merge)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct DoomConfig {
|
||||
aot: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Merge)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Rustup {
|
||||
@@ -482,6 +488,9 @@ pub struct ConfigFile {
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
vscode: Option<VscodeConfig>,
|
||||
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
doom: Option<DoomConfig>,
|
||||
|
||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||
rustup: Option<Rustup>,
|
||||
}
|
||||
@@ -1772,6 +1781,14 @@ impl Config {
|
||||
Some(profile.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn doom_aot(&self) -> bool {
|
||||
self.config_file
|
||||
.doom
|
||||
.as_ref()
|
||||
.and_then(|doom| doom.aot)
|
||||
.unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -65,7 +65,11 @@ impl Emacs {
|
||||
command.arg("--force");
|
||||
}
|
||||
|
||||
command.args(["upgrade"]);
|
||||
command.arg("upgrade");
|
||||
|
||||
if ctx.config().doom_aot() {
|
||||
command.arg("--aot");
|
||||
}
|
||||
|
||||
command.status_checked()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user