| # This file is part of ICU4X. For terms of use, please see the file | |
| # called LICENSE at the top level of the ICU4X source tree | |
| # (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). | |
| # This is a cargo-make file included in the toplevel Makefile.toml | |
| [tasks.check-all-features-chunked] | |
| description = "Build all permutations of all features for the provided chunk index (3 chunks)" | |
| category = "ICU4X Development" | |
| install_crate = { crate_name = "cargo-all-features", binary = "cargo-check-all-features", test_arg = ["--help"] } | |
| install_crate_args = ["--version", "^1.11"] | |
| env = { RUSTFLAGS = "-Dwarnings", "ICU4X_DATA_DIR" = "../stubdata" } | |
| command = "cargo" | |
| args = ["check-all-features", "--chunk-granularity", "feature", "--n-chunks", "4", "--chunk", "${@}"] | |
| [tasks.check-all-features] | |
| description = "Build all permutations of all features" | |
| category = "ICU4X Development" | |
| install_crate = { crate_name = "cargo-all-features", binary = "cargo-check-all-features", test_arg = ["--help"] } | |
| install_crate_args = ["--version", "^1.11"] | |
| env = { RUSTFLAGS = "-Dwarnings", "ICU4X_DATA_DIR" = "../stubdata" } | |
| command = "cargo" | |
| args = ["check-all-features"] | |
| [tasks.build-all-features] | |
| description = "Build all permutations of all features" | |
| category = "ICU4X Development" | |
| install_crate = { crate_name = "cargo-all-features", binary = "cargo-build-all-features", test_arg = ["--help"] } | |
| install_crate_args = ["--version", "^1.11"] | |
| env = { RUSTFLAGS = "-Dwarnings", "ICU4X_DATA_DIR" = "../stubdata" } | |
| command = "cargo" | |
| args = ["build-all-features"] | |
| [tasks.setup-test-rustflags] | |
| private = true | |
| script_runner = "@duckscript" | |
| script = ''' | |
| rustflags = get_env RUSTFLAGS | |
| if not ${rustflags} | |
| set_env RUSTFLAGS "--cfg=icu4x_run_size_tests" | |
| else | |
| set_env RUSTFLAGS "--cfg=icu4x_run_size_tests ${rustflags}" | |
| end | |
| ''' | |
| [tasks.test-all-features] | |
| description = "Run all Rust tests with all features and targets" | |
| category = "ICU4X Development" | |
| # This might be required if Windows runs out of disk again | |
| # env = { RUSTFLAGS = "-Cdebuginfo=none -Cdebug-assertions=true", condition = { platforms = ["windows"] } } | |
| dependencies = ["setup-test-rustflags"] | |
| command = "cargo" | |
| args = ["test", "--all-features", "--all-targets", "--no-fail-fast"] | |
| [tasks.test-dev-without-assertions] | |
| description = "Run all Rust unit and integration tests without debug assertions (GIGO mode)" | |
| category = "ICU4X Development" | |
| command = "cargo" | |
| args = ["test", "--profile=dev-without-assertions", "--all-features", "--tests", "--no-fail-fast"] | |
| [tasks.test-docs] | |
| description = "Run all Rust doctests with all features" | |
| category = "ICU4X Development" | |
| command = "cargo" | |
| args = ["test", "--all-features", "--doc", "--no-fail-fast"] | |
| [tasks.check-tutorials-local] | |
| description = "Build the Cargo tutorial projects based on local crates" | |
| category = "ICU4X Development" | |
| script_runner = "@duckscript" | |
| script = ''' | |
| exit_on_error true | |
| pwd = pwd | |
| set_env CARGO_TARGET_DIR ${pwd}/target | |
| cd examples/cargo | |
| exec --fail-on-error cargo check -m default/Cargo.toml | |
| exec --fail-on-error cargo check -m buffer/Cargo.toml | |
| exec --fail-on-error cargo check -m experimental/Cargo.toml | |
| exec --fail-on-error cargo check -m sync/Cargo.toml | |
| # baked requires a datagen release build | |
| # custom_compiled doesn't compile without data | |
| ''' | |
| [tasks.test-cargo] | |
| description = "Build and run the Cargo tutorial projects based on local crates" | |
| category = "ICU4X Development" | |
| script_runner = "@duckscript" | |
| script = ''' | |
| exit_on_error true | |
| project_dir = pwd | |
| set_env CARGO_TARGET_DIR ${project_dir}/target | |
| is_windows = is_windows | |
| if ${is_windows} | |
| binary_ext = set ".exe" | |
| else | |
| binary_ext = set "" | |
| end | |
| exec --fail-on-error cargo build -p icu4x-datagen | |
| cd examples/cargo | |
| mkdir bin | |
| cp ${project_dir}/target/debug/icu4x-datagen${binary_ext} bin/icu4x-datagen${binary_ext} | |
| exec --fail-on-error cargo run -m default/Cargo.toml | |
| exec --fail-on-error cargo run -m experimental/Cargo.toml | |
| exec --fail-on-error cargo run -m sync/Cargo.toml | |
| exec --fail-on-error cargo run -m baked/Cargo.toml | |
| exec --fail-on-error cargo run -m harfbuzz/Cargo.toml | |
| # Copy our own tutorial_buffer to speed up the task | |
| exec --fail-on-error cargo build -m buffer/Cargo.toml | |
| mkdir buffer/bin | |
| cp ${project_dir}/target/debug/tutorial_buffer${binary_ext} buffer/bin/tutorial_buffer${binary_ext} | |
| exec --fail-on-error make -C buffer buffer_data.postcard | |
| exec --fail-on-error cargo run -m buffer/Cargo.toml | |
| exec --fail-on-error make -C custom_compiled baked_data/mod.rs | |
| set_env ICU4X_DATA_DIR ${project_dir}/examples/cargo/custom_compiled/baked_data | |
| exec --fail-on-error cargo run -m custom_compiled/Cargo.toml | |
| ''' | |
| [tasks.install-cortex-7] | |
| description = "Install the thumbv7m target" | |
| category = "ICU4X Development" | |
| command = "rustup" | |
| args = [ | |
| "target", "add", "thumbv7m-none-eabi", | |
| ] | |
| [tasks.check-nostd] | |
| description = "Ensure ICU4X builds on no-std" | |
| category = "ICU4X Development" | |
| dependencies = ["install-cortex-7"] | |
| command = "cargo" | |
| args = ["check", "--package", "icu_capi", "--target", "thumbv7m-none-eabi", "--no-default-features", "--features=buffer_provider"] |