mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 15:04:32 +01:00
xtask: Do not add rtic features to all workspace crates
This commit is contained in:
parent
60bd09117d
commit
bb8621f2d7
1 changed files with 80 additions and 32 deletions
|
@ -386,18 +386,34 @@ fn cargo_build(
|
||||||
package: &Package,
|
package: &Package,
|
||||||
backend: Backends,
|
backend: Backends,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
let packages_to_check = package_filter(package);
|
||||||
|
if packages_to_check.contains(&"rtic".to_owned()) {
|
||||||
|
// rtic crate has features which needs special handling
|
||||||
let s = format!("{},{}", DEFAULT_FEATURES, backend.to_rtic_feature());
|
let s = format!("{},{}", DEFAULT_FEATURES, backend.to_rtic_feature());
|
||||||
let features: Option<&str> = Some(&s);
|
let features: Option<&str> = Some(&s);
|
||||||
|
|
||||||
command_parser(
|
command_parser(
|
||||||
&CargoCommand::Build {
|
&CargoCommand::Build {
|
||||||
cargoarg,
|
cargoarg,
|
||||||
package: package_filter(package),
|
package: packages_to_check,
|
||||||
target: backend.to_target(),
|
target: backend.to_target(),
|
||||||
features,
|
features,
|
||||||
mode: BuildMode::Release,
|
mode: BuildMode::Release,
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
)?;
|
)?;
|
||||||
|
} else {
|
||||||
|
command_parser(
|
||||||
|
&CargoCommand::Build {
|
||||||
|
cargoarg,
|
||||||
|
package: package_filter(package),
|
||||||
|
target: backend.to_target(),
|
||||||
|
features: None,
|
||||||
|
mode: BuildMode::Release,
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,8 +422,12 @@ fn cargo_check(
|
||||||
package: &Package,
|
package: &Package,
|
||||||
backend: Backends,
|
backend: Backends,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
let packages_to_check = package_filter(package);
|
||||||
|
if packages_to_check.contains(&"rtic".to_owned()) {
|
||||||
|
// rtic crate has features which needs special handling
|
||||||
let s = format!("{},{}", DEFAULT_FEATURES, backend.to_rtic_feature());
|
let s = format!("{},{}", DEFAULT_FEATURES, backend.to_rtic_feature());
|
||||||
let features: Option<&str> = Some(&s);
|
let features: Option<&str> = Some(&s);
|
||||||
|
|
||||||
command_parser(
|
command_parser(
|
||||||
&CargoCommand::Check {
|
&CargoCommand::Check {
|
||||||
cargoarg,
|
cargoarg,
|
||||||
|
@ -417,6 +437,17 @@ fn cargo_check(
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
)?;
|
)?;
|
||||||
|
} else {
|
||||||
|
command_parser(
|
||||||
|
&CargoCommand::Check {
|
||||||
|
cargoarg,
|
||||||
|
package: package_filter(package),
|
||||||
|
target: backend.to_target(),
|
||||||
|
features: None,
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,6 +456,22 @@ fn cargo_clippy(
|
||||||
package: &Package,
|
package: &Package,
|
||||||
backend: Backends,
|
backend: Backends,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
let packages_to_check = package_filter(package);
|
||||||
|
if packages_to_check.contains(&"rtic".to_owned()) {
|
||||||
|
// rtic crate has features which needs special handling
|
||||||
|
let s = format!("{},{}", DEFAULT_FEATURES, backend.to_rtic_feature());
|
||||||
|
let features: Option<&str> = Some(&s);
|
||||||
|
|
||||||
|
command_parser(
|
||||||
|
&CargoCommand::Clippy {
|
||||||
|
cargoarg,
|
||||||
|
package: package_filter(package),
|
||||||
|
target: backend.to_target(),
|
||||||
|
features,
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
)?;
|
||||||
|
} else {
|
||||||
command_parser(
|
command_parser(
|
||||||
&CargoCommand::Clippy {
|
&CargoCommand::Clippy {
|
||||||
cargoarg,
|
cargoarg,
|
||||||
|
@ -434,6 +481,7 @@ fn cargo_clippy(
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
)?;
|
)?;
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue