[config] skip_core_tasks = true [tasks.create-target-dir] script_runner = "@rust" script = [ ''' fn main() { std::fs::DirBuilder::new().recursive(true).create("./target/").unwrap(); } ''' ] [tasks.assemble] dependencies = ["create-target-dir"] command = "arm-none-eabi-as" args = ["crt0.s", "-o", "target/crt0.o"] [tasks.build-examples-debug] dependencies = ["assemble"] command = "cargo" args = ["xbuild", "--examples", "--target", "thumbv4-none-agb.json"] [tasks.build-examples-release] dependencies = ["assemble"] command = "cargo" args = ["xbuild", "--examples", "--target", "thumbv4-none-agb.json", "--release"] [tasks.pack-roms] script_runner = "@rust" script = [ ''' fn main() -> std::io::Result<()> { for entry in std::fs::read_dir("examples/")? { let entry = entry?; let mut path = entry.path(); if path.is_dir() { continue; } else { path.set_extension(""); let name = path.file_name().unwrap().to_str().unwrap(); println!("{}", name); std::process::Command::new("arm-none-eabi-objcopy").args( &["-O", "binary", &format!("target/thumbv4-none-agb/release/examples/{}",name), &format!("target/{}.gba",name)]) .output().expect("failed to objcopy!"); std::process::Command::new("gbafix").args( &[&format!("target/{}.gba",name)]) .output().expect("failed to gbafix!"); } } Ok(()) } ''' ] [tasks.test] command = "cargo" args = ["test", "--lib"] [tasks.justrelease] dependencies = ["build-examples-release", "pack-roms"] [tasks.build-all] dependencies = ["build-examples-debug", "build-examples-release", "pack-roms"] [tasks.default] alias = "build-all"