1 | set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] |
2 |
|
3 | [private] |
4 | default: |
5 | @just --list |
6 |
|
7 | [private] |
8 | bloat: |
9 | cargo bloat --release -n 1000 |
10 |
|
11 |
|
12 | fmt: |
13 | cargo +nightly fmt --all -- --config format_code_in_doc_comments=true |
14 |
|
15 |
|
16 | check: |
17 | cargo check --all |
18 |
|
19 |
|
20 | clippy: |
21 | cargo clippy --all |
22 |
|
23 |
|
24 | test: |
25 | cargo test --all |
26 |
|
27 |
|
28 | precommit: fmt check clippy test |
29 |
|
30 | [linux] |
31 | python: |
32 | rm -rf python/dist |
33 | pip install -r python/requirements.txt |
34 | cargo build --lib --release |
35 | cargo run --bin uniffi-bindgen generate --library target/release/libnostr_sdk_ffi.so --language python --no-format -o python/src/nostr-sdk/ |
36 | cp target/release/libnostr_sdk_ffi.so python/src/nostr-sdk/ |
37 | cd python && python setup.py bdist_wheel |
38 | pip install ./python/dist/nostr_sdk*.whl --force-reinstall |
39 |
|
40 | [macos] |
41 | python: |
42 | rm -rf python/dist |
43 | pip install -r python/requirements.txt |
44 | cargo build --lib --release |
45 | cargo run --bin uniffi-bindgen generate --library target/release/libnostr_sdk_ffi.dylib --language python --no-format -o python/src/nostr-sdk/ |
46 | cp target/release/libnostr_sdk_ffi.dylib python/src/nostr-sdk/ |
47 | cd python && python setup.py bdist_wheel |
48 | pip install ./python/dist/nostr_sdk*.whl --force-reinstall |
49 |
|
50 | [windows] |
51 | python: |
52 | pip install -r python\requirements.txt |
53 | cargo build --lib --release |
54 | cargo run --bin uniffi-bindgen generate --library target\release\nostr_sdk_ffi.dll --language python --no-format -o python\src\nostr-sdk\ |
55 | copy target\release\nostr_sdk_ffi.dll python\src\nostr-sdk |
56 | del /F /Q python\dist\* 2>nul || exit /b 0 |
57 | cd python && python setup.py bdist_wheel |
58 | FOR %%i in (.\python\dist\*.whl) DO pip install %i --force-reinstall |
59 |
|