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] [features]
default = [] default = []
algorithms = [] all-algorithms = []
[[bin]]
name = "sha256sum"
path = "src/bin/sha256sum.rs"
required-features = []
[[bin]] [[bin]]
name = "picca" name = "picca"
path = "src/bin/picca.rs" path = "src/bin/picca.rs"
required-features = ["algorithms"] required-features = ["all-algorithms"]
[dependencies] [dependencies]
sha2 = "0.10.9" sha2 = "0.10.9"

View file

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

View file

@ -6,7 +6,7 @@ WORKDIR /usr/src/picca
COPY . . COPY . .
RUN apk upgrade --no-cache && apk add musl-dev 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 FROM alpine:3 AS package

View file

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