From 34c9d83cba5f9a75e05ba29535f0e6290a11c811 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 11 Mar 2022 19:04:11 +0800 Subject: [PATCH] add a hack to change the locale for tts builds unfortunately it greatly increases build times. need to think about this but at least it prevents me from checking in a locale file that breaks all the other dev's builds --- xtask/src/main.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index f944801fd..4bae45272 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -221,6 +221,14 @@ fn main() -> Result<(), Box> { "../espeak-embedded/target/riscv32imac-unknown-xous-elf/release/espeak-embedded".to_string() }; + let mut locale_override = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .truncate(true) + .open("xous-rs/src/locale.rs").expect("Can't open locale for modification"); + write!(locale_override, "{}", "pub const LANG: &str = \"en-tts\";\n").unwrap(); + let mut args = env::args(); args.nth(1); let mut pkgs = hw_pkgs.to_vec(); @@ -238,7 +246,14 @@ fn main() -> Result<(), Box> { &pkgs, None, None, Some(&["--features", "tts", "--features", "braille",]), - &[&tts_exec_string], None)? + &[&tts_exec_string], None)?; + let mut locale_revert = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .truncate(true) + .open("xous-rs/src/locale.rs").expect("Can't open locale for modification"); + write!(locale_revert, "{}", "pub const LANG: &str = \"en\";\n").unwrap(); } Some("libstd-test") => { let mut args = env::args();