-
Notifications
You must be signed in to change notification settings - Fork 9
/
Cargo.toml
149 lines (129 loc) · 4.1 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
[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'
'''