set up building main bin with feature
This commit is contained in:
parent
480a9f72fb
commit
22095ec627
4 changed files with 6 additions and 9 deletions
|
@ -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"
|
||||||
|
|
2
Justfile
2
Justfile
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue