| 1 | [tasks.compile-list] |
| 2 | env = { "CARGO_MAKE_RUST_SCRIPT_PROVIDER" = "cargo-play" } |
| 3 | script_runner = "@rust" |
| 4 | script = ''' |
| 5 | //# psl-codegen = "0.9" |
| 6 | |
| 7 | fn main() { |
| 8 | let list = psl_codegen::compile_psl("data/rules.txt"); |
| 9 | |
| 10 | let module = format!("//! This file is automatically @generated by cargo-make. |
| 11 | //! It is not intended for manual editing. |
| 12 | |
| 13 | #![allow(clippy::all)] // TODO lint this code? |
| 14 | |
| 15 | {}", list); |
| 16 | |
| 17 | std::fs::write("src/list.rs", module).unwrap(); |
| 18 | } |
| 19 | ''' |
| 20 | |
| 21 | [tasks.format] |
| 22 | install_crate = "rustfmt" |
| 23 | command = "cargo" |
| 24 | args = ["fmt", "--all"] |
| 25 | dependencies = ["compile-list"] |
| 26 | |
| 27 | [tasks.check] |
| 28 | command = "cargo" |
| 29 | args = ["check", "--all-features"] |
| 30 | dependencies = ["format"] |
| 31 | |
| 32 | [tasks.build] |
| 33 | command = "cargo" |
| 34 | args = ["build", "--all-features"] |
| 35 | dependencies = ["format"] |
| 36 | |
| 37 | [tasks.clippy] |
| 38 | command = "cargo" |
| 39 | args = ["clippy", "--all-features"] |
| 40 | dependencies = ["format"] |
| 41 | |
| 42 | [tasks.test] |
| 43 | command = "cargo" |
| 44 | args = ["test", "--all-features"] |
| 45 | dependencies = ["format"] |