-
Notifications
You must be signed in to change notification settings - Fork 20
chore: make justfile fully compatible with Windows/PowerShell #100
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
f0ede1e
cd8c706
cc2505c
0822dce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| # Allow experimental features like [group(...)] | ||
| set unstable := true | ||
|
|
||
| set shell := ["sh", "-c"] | ||
|
|
||
| set windows-shell := ["powershell.exe", "-Command"] | ||
|
|
||
| [group("Repo")] | ||
| [doc("Default command; list all available commands.")] | ||
| @list: | ||
|
|
@@ -6,7 +13,11 @@ | |
| [group("Repo")] | ||
| [doc("Open repo on GitHub in your default browser.")] | ||
| repo: | ||
| open https://github.com/bitcoindevkit/bdk-dart | ||
| {{ if os() == "windows" { | ||
| "Start-Process https://github.com/bitcoindevkit/bdk-dart" | ||
| } else { | ||
| "open https://github.com/bitcoindevkit/bdk-dart" | ||
| } }} | ||
|
|
||
| [group("Dart")] | ||
| [doc("Format the Dart codebase.")] | ||
|
|
@@ -31,17 +42,29 @@ test *ARGS: | |
| [group("Bindings")] | ||
| [doc("Build native library and regenerate bindings.")] | ||
| generate-bindings: | ||
| bash ./scripts/generate_bindings.sh | ||
| {{ if os() == "windows" { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This multi-line interpolation has the same parser issue as the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed the requested fix now. |
||
| "cd native; cargo build --profile dev; cargo run --profile dev --bin uniffi-bindgen -- generate --library target\\debug\\bdk_dart_ffi.dll --language dart --config uniffi.toml --out-dir ..\\lib\\" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small behavior note: PowerShell
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, great point I'll look into fixing that. |
||
| } else { | ||
| "bash ./scripts/generate_bindings.sh" | ||
| } }} | ||
|
|
||
| [group("Demo")] | ||
| [doc("Run Flutter analysis for the demo app.")] | ||
| demo-analyze: | ||
| cd bdk_demo && flutter analyze | ||
| {{ if os() == "windows" { | ||
| "cd bdk_demo ; flutter analyze" | ||
| } else { | ||
| "cd bdk_demo && flutter analyze" | ||
| } }} | ||
|
|
||
| [group("Demo")] | ||
| [doc("Run Flutter tests for the demo app.")] | ||
| demo-test *ARGS: | ||
| cd bdk_demo && flutter test {{ if ARGS == "" { "" } else { ARGS } }} | ||
| {{ if os() == "windows" { | ||
| "cd bdk_demo ; flutter test " + (if ARGS == "" { "" } else { ARGS }) | ||
| } else { | ||
| "cd bdk_demo && flutter test " + (if ARGS == "" { "" } else { ARGS }) | ||
| } }} | ||
|
|
||
| [group("CI")] | ||
| [doc("Run the same checks as CI.")] | ||
|
|
@@ -55,11 +78,8 @@ ci: | |
| [group("Dart")] | ||
| [doc("Remove build and tool artifacts to start fresh.")] | ||
| clean: | ||
| rm -rf .dart_tool/ | ||
| rm -rf build/ | ||
| rm -rf native/target/ | ||
| rm -rf coverage/ | ||
| rm -rf bdk_demo/.dart_tool/ | ||
| rm -rf bdk_demo/build/ | ||
| rm -rf example/.dart_tool/ | ||
| rm -rf example/build/ | ||
| {{ if os() == "windows" { | ||
| "'.dart_tool', 'build', 'native/target', 'coverage', 'bdk_demo/.dart_tool', 'bdk_demo/build', 'example/.dart_tool', 'example/build' | Where-Object { Test-Path $_ } | ForEach-Object { Remove-Item -Recurse -Force $_ }" | ||
| } else { | ||
| "rm -rf .dart_tool/ build/ native/target/ coverage/ bdk_demo/.dart_tool/ bdk_demo/build/ example/.dart_tool/ example/build/" | ||
| } }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small cross-platform note: this still uses macOS
openfor every non-Windows OS. Since this PR is improving cross-platform Justfile support, should we usexdg-openon Linux and keepopenonly for macOS?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a good idea, i assumed the current justfile support Linux as well, I just test all the
justcommands on my WSL, they all passed except thejust repocommand.I'll look into that as well. Thanks!