Skip to content

Commit

Permalink
tidy: tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
jondot committed May 12, 2024
1 parent 5bb5e58 commit 92cdb5c
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Example format:

# Providers

You can get a list of the providers and their described configuration values [in the documentation](https://docs.rs/teller).
You can get a list of the providers and their described configuration values [in the documentation](https://docs.rs/teller-providers/latest/teller_providers/providers/index.html).

### Testing check list:

Expand Down
1 change: 1 addition & 0 deletions release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tag-name = "v{{version}}"
1 change: 1 addition & 0 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ edition = "2021"

[dependencies]

clap = "3"
xtaskops = "^0.4.1"
anyhow = "1"
68 changes: 66 additions & 2 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
fn main() -> Result<(), anyhow::Error> {
xtaskops::tasks::main()
use anyhow::{self, Context};
/// main
///
/// # Errors
///
/// This function will return an error
pub fn main() -> anyhow::Result<()> {
use clap::{AppSettings, Arg, Command};
let cli = Command::new("xtask")
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand(
Command::new("coverage").arg(
Arg::new("dev")
.short('d')
.long("dev")
.help("generate an html report")
.takes_value(false),
),
)
.subcommand(Command::new("vars"))
.subcommand(Command::new("ci"))
.subcommand(Command::new("powerset"))
.subcommand(
Command::new("bloat-deps").arg(
Arg::new("package")
.short('p')
.long("package")
.help("package to build")
.required(true)
.takes_value(true),
),
)
.subcommand(
Command::new("bloat-time").arg(
Arg::new("package")
.short('p')
.long("package")
.help("package to build")
.required(true)
.takes_value(true),
),
)
.subcommand(Command::new("docs"));
let matches = cli.get_matches();

let root = xtaskops::ops::root_dir();
let res = match matches.subcommand() {
Some(("coverage", sm)) => xtaskops::tasks::coverage(sm.is_present("dev")),
Some(("vars", _)) => {
println!("root: {root:?}");
Ok(())
}
Some(("ci", _)) => xtaskops::tasks::ci(),
Some(("docs", _)) => xtaskops::tasks::docs(),
Some(("powerset", _)) => xtaskops::tasks::powerset(),
Some(("bloat-deps", sm)) => xtaskops::tasks::bloat_deps(
sm.get_one::<String>("package")
.context("please provide a package with -p")?,
),
Some(("bloat-time", sm)) => xtaskops::tasks::bloat_time(
sm.get_one::<String>("package")
.context("please provide a package with -p")?,
),
_ => unreachable!("unreachable branch"),
};
res
}

0 comments on commit 92cdb5c

Please sign in to comment.