set up building main bin with feature

This commit is contained in:
Bryson Steck 2025-08-13 00:29:22 -06:00
parent 480a9f72fb
commit 22095ec627
Signed by: bryson
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4
4 changed files with 6 additions and 9 deletions

View file

@ -6,17 +6,12 @@ autobins = true
[features]
default = []
algorithms = []
[[bin]]
name = "sha256sum"
path = "src/bin/sha256sum.rs"
required-features = []
all-algorithms = []
[[bin]]
name = "picca"
path = "src/bin/picca.rs"
required-features = ["algorithms"]
required-features = ["all-algorithms"]
[dependencies]
sha2 = "0.10.9"

View file

@ -14,10 +14,12 @@ default: build-docker build-release doc
# main build
build-release:
cargo build --release
cargo build --release --bin picca --features all-algorithms
# debug build
build-debug:
cargo build
cargo build --bin picca --features all-algorithms
# build docker images locally
build-docker: clean

View file

@ -6,7 +6,7 @@ WORKDIR /usr/src/picca
COPY . .
RUN apk upgrade --no-cache && apk add musl-dev
RUN cargo install --path . && cargo clean
RUN cargo install --path . --bin picca --features all-algorithms && cargo clean
FROM alpine:3 AS package

View file

@ -82,7 +82,7 @@ pub struct Args {
)]
pub debug: bool,
#[cfg(feature = "algorithms")]
#[cfg(feature = "all-algorithms")]
#[arg(
short,
long,