Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature flag for vendored sqlcipher #12

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
.env
harbor.sqlite
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name = "harbor"
version = "0.1.0"
edition = "2021"

[features]
default = []
vendored = ["rusqlite/bundled-sqlcipher-vendored-openssl"]

[dependencies]
anyhow = "1"
log = "0.4"
Expand Down
Binary file removed harbor.sqlite
Binary file not shown.
14 changes: 10 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
test:
cargo test
# Load environment variables from .env file
set dotenv-load := true

# Define a variable that holds the feature flag if USE_VENDOR_FEATURE is set
FEATURE_FLAG := if env('USE_VENDOR_FEATURE', '0') == "1" { "--features vendored" } else { "" }

run:
RUST_LOG=harbor=debug,info cargo run
RUST_LOG=harbor=debug,info cargo run {{FEATURE_FLAG}}

test:
cargo test {{FEATURE_FLAG}}

release:
cargo run --release
cargo run --release {{FEATURE_FLAG}}

clippy:
cargo clippy --all-features --tests -- -D warnings
Expand Down