[package] name = "cargo-run-bin" version = "1.7.4" authors = ["Dustin Blackman"] categories = ["command-line-utilities", "development-tools::cargo-plugins"] edition = "2021" homepage = "https://github.com/dustinblackman/cargo-run-bin" keywords = ["dev-experiance", "developer-experiance", "bin", "cache", "cli"] license = "MIT" readme = "README.md" repository = "https://github.com/dustinblackman/cargo-run-bin" rust-version = "1.70.0" description = "Build, cache, and run binaries scoped in Cargo.toml rather than installing globally. This acts similarly to npm run and gomodrun, and allows your teams to always be running the same tooling versions." exclude = [ ".cargo-husky", "tests/", "cliff.toml", "deny.toml", "rust-toolchain.toml" ] [[bin]] name = "cargo-bin" path = "src/main.rs" required-features = ["cli"] [features] default = ["cli"] cli = ["dep:clap"] [dependencies] anyhow = "1.0.40" cfg-if = "1.0.0" clap = { version = "4.3.19", optional = true } rustversion = "1.0.14" serde = { version = "1.0.149", features = ["derive"] } toml = "0.5.9" toml_edit = "0.19.14" version_check = "0.9.3" which = "4.4.0" [dev-dependencies] assert_cmd = "2.0.12" cargo-husky = { version = "1.5.0", default-features = false, features = ["user-hooks"] } insta = { version = "1.31.0", features = ["yaml"] } [package.metadata.bin] cargo-cmd = { version = "0.3.1", locked = true } cargo-deny = { version = "0.13.5", locked = true } cargo-gha = { version = "1.0.2", locked = true } cargo-insta = { version = "1.31.0", locked = true } cargo-llvm-cov = { version = "0.5.25", locked = true } cargo-nextest = { version = "0.9.57", locked = true } cargo-watch = { version = "8.4.0", locked = true } committed = { version = "1.0.20", locked = true } git-cliff = { version = "1.3.1", locked = true } # Just added for testing dustinblackman-hello-world = { version = "0.2.1", git = "https://github.com/dustinblackman/rust-hello-world", bins = ["hello-world-first", "hello-world-second"] } [package.metadata.docs.rs] all-features = false features = [] [package.metadata.gha] targets = ["aarch64-apple-darwin"] [[package.metadata.gha.assets]] owner_repo = "cli/cli" tag = "v2.40.1" binaries = ["gh"] target_archives = { aarch64-apple-darwin = "gh_{NOVTAG}_macOS_arm64.zip" } [profile.dev.package.insta] opt-level = 3 [profile.dev.package.similar] opt-level = 3 [profile.release] opt-level = 3 lto = "thin" strip = "symbols" [profile.dist] inherits = "release" [package.metadata.commands] lint = '''set -e cargo cmd setup-nightly cargo +runbin-nightly fmt -- --check cargo clippy cargo deny check licenses -s ''' lint-fix = '''set -e cargo cmd setup-nightly cargo clippy --fix --allow-dirty cargo fix --allow-dirty cargo +runbin-nightly fmt ''' get-nightly-name = 'echo runbin-nightly' setup-nightly = ''' export NIGHTLY=nightly-2023-06-16 rustup toolchain list -v | grep -q "$NIGHTLY" || rustup toolchain install "$NIGHTLY" --force --component llvm-tools-preview rustfmt rustup toolchain link runbin-nightly "$(rustup toolchain list -v | grep $NIGHTLY | grep '^nightly-' | awk '{print $2}')" ''' release = '''set -e export RB_VERSION=$(cat Cargo.toml | grep version | head -n1 | awk -F '"' '{print $2}') cargo check cargo bin git-cliff -o CHANGELOG.md --tag "v$RB_VERSION" git add . git commit -m "feat: Release v$RB_VERSION" git tag -a "v$RB_VERSION" -m "v$RB_VERSION" git push git push --tags cargo publish cargo gha gh release create "v$RB_VERSION" --generate-notes cargo bin git-cliff --latest --strip header | cargo gha gh release edit "v$RB_VERSION" --notes-file - ''' test-coverage = '''set -e rm -rf .tmp cargo build cargo llvm-cov nextest -j 1 --ignore-filename-regex='_test.rs' ''' test-coverage-html = '''set -e rm -rf .tmp cargo build cargo llvm-cov nextest -j 1 --open --ignore-filename-regex='_test.rs' ''' test-coverage-lcov = '''set -e rm -rf .tmp cargo build rm -f lcov.info cargo llvm-cov nextest -j 1 --lcov --output-path lcov.info --ignore-filename-regex='_test.rs' ''' test = '''set -e rm -rf .tmp cargo build cargo nextest run -j 1 ''' test-watch = '''set -e cargo watch -i .cargo -x 'cmd test' '''