on master help sign in
Cargo.toml: Introduce 'quick-build-application' feature

Use it like this: cargo build --no-default-features --features quick-build-application It reduces dependencies to build from 154 to 125, allowing quicker iteration when developing the app.

commitcb4973987b238bfc7cb63e47950a13e815706592 authorMartin Nordholts <enselic@gmail.com> dateSun 8 Aug 2021, 06:35 (5 years ago) parent905902d
2 files changed+23−2
.github/workflows/CICD.yml+7 Cargo.toml+16−2
.github/workflows/CICD.yml+7
@@ -246,6 +246,13 @@ jobs:
246246 command: check
247247 args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
248248
249+ - name: "Feature check: quick-build-application"
250+ uses: actions-rs/cargo@v1
251+ with:
252+ use-cross: ${{ matrix.job.use-cross }}
253+ command: check
254+ args: --locked --target=${{ matrix.job.target }} --verbose --no-default-features --features quick-build-application
255+
249256 - name: Create tarball
250257 id: package
251258 shell: bash
Cargo.toml+16−2
@@ -12,10 +12,11 @@ build = "build.rs"
1212edition = '2018'
1313
1414[features]
15−default = ["application"]
15+default = ["full-application"]
1616# Feature required for bat the application. Should be disabled when depending on
1717# bat as a library.
18−application = [
18+full-application = [
19+ "application",
1920 "atty",
2021 "bugreport",
2122 "clap",
@@ -26,6 +27,19 @@ application = [
2627 "regex-onig",
2728 "wild",
2829]
30+# Mainly for developers that want to iterate quickly
31+# Be aware that the included features might change in the future
32+quick-build-application = [
33+ "application",
34+ "atty",
35+ "clap",
36+ "dirs-next",
37+ "lazy_static",
38+ "paging",
39+ "regex-onig",
40+ "wild",
41+]
42+application = []
2943git = ["git2"] # Support indicating git modifications
3044paging = ["shell-words"] # Support applying a pager on the output
3145