Skip to content

Commit

Permalink
Merge pull request #1016 from get10101/allow-setting-rust-log
Browse files Browse the repository at this point in the history
Allow setting RUST_LOG to any value in `just all`
  • Loading branch information
klochowicz authored Aug 1, 2023
2 parents c84232a + 0c9a0f9 commit 1f52d2a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ get_local_ip := if os() == "linux" {
"ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'"
}

# RUST_LOG is overriden for FRB codegen invocations it if RUST_LOG isn't info or debug, which means
# a command like `RUST_LOG="warn" just all` would fail
rust_log_for_frb := if env_var_or_default("RUST_LOG", "") =~ "(?i)(trace)|(debug)" {
"debug"
} else {
"info"
}


default: gen
precommit: gen lint
Expand All @@ -44,7 +52,7 @@ gen:
set -euxo pipefail
cd mobile
flutter pub get
flutter_rust_bridge_codegen \
RUST_LOG={{ rust_log_for_frb }} flutter_rust_bridge_codegen \
--rust-input native/src/api.rs \
--c-output ios/Runner/bridge_generated.h \
--extra-c-output-path macos/Runner/ \
Expand Down

0 comments on commit 1f52d2a

Please sign in to comment.