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