From cb4973987b238bfc7cb63e47950a13e815706592 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sun, 8 Aug 2021 06:35:34 +0200 Subject: [PATCH] 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. --- .github/workflows/CICD.yml | 7 +++++++ Cargo.toml | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index e726686..45f2054 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -246,6 +246,13 @@ jobs: command: check args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging + - name: "Feature check: quick-build-application" + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.job.use-cross }} + command: check + args: --locked --target=${{ matrix.job.target }} --verbose --no-default-features --features quick-build-application + - name: Create tarball id: package shell: bash diff --git a/Cargo.toml b/Cargo.toml index f3d1197..7a19908 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,10 +12,11 @@ build = "build.rs" edition = '2018' [features] -default = ["application"] +default = ["full-application"] # Feature required for bat the application. Should be disabled when depending on # bat as a library. -application = [ +full-application = [ + "application", "atty", "bugreport", "clap", @@ -26,6 +27,19 @@ application = [ "regex-onig", "wild", ] +# Mainly for developers that want to iterate quickly +# Be aware that the included features might change in the future +quick-build-application = [ + "application", + "atty", + "clap", + "dirs-next", + "lazy_static", + "paging", + "regex-onig", + "wild", +] +application = [] git = ["git2"] # Support indicating git modifications paging = ["shell-words"] # Support applying a pager on the output