mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
xtask: Move info prints into run
This commit is contained in:
parent
38c364473c
commit
5131474221
2 changed files with 30 additions and 48 deletions
|
|
@ -178,43 +178,27 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
let final_run_results = match &cli.command {
|
||||
Commands::Format(args) => cargo_format(globals, &cargologlevel, &args.package, args.check),
|
||||
Commands::Clippy(args) => {
|
||||
info!("Running clippy on backend: {backend:?}");
|
||||
cargo_clippy(globals, &cargologlevel, args, backend)
|
||||
}
|
||||
Commands::Check(args) => {
|
||||
info!("Checking on backend: {backend:?}");
|
||||
cargo(globals, BuildOrCheck::Check, &cargologlevel, args, backend)
|
||||
}
|
||||
Commands::Build(args) => {
|
||||
info!("Building for backend: {backend:?}");
|
||||
cargo(globals, BuildOrCheck::Build, &cargologlevel, args, backend)
|
||||
}
|
||||
Commands::ExampleCheck => {
|
||||
info!("Checking on platform: {platform:?}, backend: {backend:?}");
|
||||
cargo_example(
|
||||
globals,
|
||||
BuildOrCheck::Check,
|
||||
&cargologlevel,
|
||||
platform,
|
||||
backend,
|
||||
&examples_to_run,
|
||||
)
|
||||
}
|
||||
Commands::ExampleBuild => {
|
||||
info!("Building for platform: {platform:?}, backend: {backend:?}");
|
||||
cargo_example(
|
||||
globals,
|
||||
BuildOrCheck::Build,
|
||||
&cargologlevel,
|
||||
platform,
|
||||
backend,
|
||||
&examples_to_run,
|
||||
)
|
||||
}
|
||||
Commands::Clippy(args) => cargo_clippy(globals, &cargologlevel, args, backend),
|
||||
Commands::Check(args) => cargo(globals, BuildOrCheck::Check, &cargologlevel, args, backend),
|
||||
Commands::Build(args) => cargo(globals, BuildOrCheck::Build, &cargologlevel, args, backend),
|
||||
Commands::ExampleCheck => cargo_example(
|
||||
globals,
|
||||
BuildOrCheck::Check,
|
||||
&cargologlevel,
|
||||
platform,
|
||||
backend,
|
||||
&examples_to_run,
|
||||
),
|
||||
Commands::ExampleBuild => cargo_example(
|
||||
globals,
|
||||
BuildOrCheck::Build,
|
||||
&cargologlevel,
|
||||
platform,
|
||||
backend,
|
||||
&examples_to_run,
|
||||
),
|
||||
Commands::Size(args) => {
|
||||
// x86_64 target not valid
|
||||
info!("Measuring for platform: {platform:?}, backend: {backend:?}");
|
||||
build_and_check_size(
|
||||
globals,
|
||||
&cargologlevel,
|
||||
|
|
@ -226,7 +210,6 @@ fn main() -> anyhow::Result<()> {
|
|||
}
|
||||
Commands::Qemu(args) | Commands::Run(args) => {
|
||||
// x86_64 target not valid
|
||||
info!("Testing for platform: {platform:?}, backend: {backend:?}");
|
||||
qemu_run_examples(
|
||||
globals,
|
||||
&cargologlevel,
|
||||
|
|
@ -236,18 +219,9 @@ fn main() -> anyhow::Result<()> {
|
|||
args.overwrite_expected,
|
||||
)
|
||||
}
|
||||
Commands::Doc(args) => {
|
||||
info!("Running cargo doc on backend: {backend:?}");
|
||||
cargo_doc(globals, &cargologlevel, backend, &args.arguments)
|
||||
}
|
||||
Commands::Test(args) => {
|
||||
info!("Running cargo test on backend: {backend:?}");
|
||||
cargo_test(globals, args, backend)
|
||||
}
|
||||
Commands::Book(args) => {
|
||||
info!("Running mdbook");
|
||||
cargo_book(globals, &args.arguments)
|
||||
}
|
||||
Commands::Doc(args) => cargo_doc(globals, &cargologlevel, backend, &args.arguments),
|
||||
Commands::Test(args) => cargo_test(globals, args, backend),
|
||||
Commands::Book(args) => cargo_book(globals, &args.arguments),
|
||||
};
|
||||
|
||||
handle_results(globals, final_run_results).map_err(|_| anyhow::anyhow!("Commands failed"))
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ pub fn cargo<'c>(
|
|||
package: &'c PackageOpt,
|
||||
backend: Backends,
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("Building for backend: {backend:?}");
|
||||
let runner = package
|
||||
.packages()
|
||||
.flat_map(|package| {
|
||||
|
|
@ -210,6 +211,7 @@ pub fn cargo_example<'c>(
|
|||
backend: Backends,
|
||||
examples: &'c [String],
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("Checking on platform: {platform:?}, backend: {backend:?}");
|
||||
let runner = into_iter(examples).map(|example| {
|
||||
let path = format!("examples/{}", platform.name());
|
||||
let dir = Some(PathBuf::from(path));
|
||||
|
|
@ -249,6 +251,7 @@ pub fn cargo_clippy<'c>(
|
|||
package: &'c PackageOpt,
|
||||
backend: Backends,
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("Running clippy on backend: {backend:?}");
|
||||
let runner = package
|
||||
.packages()
|
||||
.flat_map(|package| {
|
||||
|
|
@ -299,6 +302,7 @@ pub fn cargo_doc<'c>(
|
|||
backend: Backends,
|
||||
arguments: &'c Option<ExtraArguments>,
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("Running cargo doc on backend: {backend:?}");
|
||||
let extra_doc_features = [
|
||||
"rtic-monotonics/cortex-m-systick",
|
||||
"rtic-monotonics/rp2040",
|
||||
|
|
@ -338,6 +342,7 @@ pub fn cargo_test<'c>(
|
|||
package: &'c PackageOpt,
|
||||
backend: Backends,
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("Running cargo test on backend: {backend:?}");
|
||||
package
|
||||
.packages()
|
||||
.map(|p| {
|
||||
|
|
@ -352,6 +357,7 @@ pub fn cargo_book<'c>(
|
|||
globals: &Globals,
|
||||
arguments: &'c Option<ExtraArguments>,
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("Running mdbook");
|
||||
vec![run_and_convert((
|
||||
globals,
|
||||
CargoCommand::Book {
|
||||
|
|
@ -374,6 +380,7 @@ pub fn qemu_run_examples<'c>(
|
|||
examples: &'c [String],
|
||||
overwrite: bool,
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("QEMU run for platform: {platform:?}, backend: {backend:?}");
|
||||
let target = backend.to_target();
|
||||
let features = Some(target.and_features(backend.to_rtic_feature()));
|
||||
|
||||
|
|
@ -420,6 +427,7 @@ pub fn build_and_check_size<'c>(
|
|||
examples: &'c [String],
|
||||
arguments: &'c Option<ExtraArguments>,
|
||||
) -> Vec<FinalRunResult<'c>> {
|
||||
info!("Measuring for platform: {platform:?}, backend: {backend:?}");
|
||||
let target = backend.to_target();
|
||||
let features = Some(target.and_features(backend.to_rtic_feature()));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue