-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathjustfile
More file actions
71 lines (53 loc) · 2 KB
/
Copy pathjustfile
File metadata and controls
71 lines (53 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# set shell:= ["cmd.exe", "/c"] ### Uncomment on Windows ###
update: flutter_get install_rust_bridge_codegen rust_update gen_rust_bridge gen_flutter format
init: flutter_get install_rust_bridge_codegen gen_rust_bridge gen_flutter
gen: flutter_get gen_rust_bridge gen_flutter
watch_rust:
flutter_rust_bridge_codegen generate --watch
watch_dart:
flutter pub run build_runner watch
gen_rust_bridge:
flutter_rust_bridge_codegen generate
flutter_get:
flutter pub get
gen_flutter:
dart run build_runner build -d
format:
cd rust && cargo fmt
dart format lib test integration_test tool
clean:
flutter clean
cd rust && cargo clean
rust_update:
cd rust && cargo update
install_rust_bridge_codegen:
cargo install flutter_rust_bridge_codegen
gen_arb:
cd lib/l10n && python ./scripts/csv_to_arb.py
flutter pub get
cd ../..
sync_forui_docs:
dart run tool/sync_forui_docs.dart
validate_news_feed:
dart run tool/validate_news_feed.dart
### Web build and run commands ###
CRATE_DIR := 'rust'
OUT_DIR := '../web/pkg'
WASM_NAME := 'rust_lib'
FEATURES := 'network_handler,xswd'
BUILD_STD := 'std,panic_abort'
WASM_TARGET := 'no-modules'
WASM_RUSTFLAGS := '-C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=--export=__heap_base -C link-arg=--export=__wasm_init_tls -C link-arg=--export=__tls_base -C link-arg=--export=__tls_size -C link-arg=--export=__tls_align -C link-arg=--shared-memory -C link-arg=--import-memory -C link-arg=--max-memory=2147483648'
run_web:
RUSTUP_TOOLCHAIN=nightly \
RUSTFLAGS='{{WASM_RUSTFLAGS}}' \
wasm-pack build \
-t {{WASM_TARGET}} \
-d "{{OUT_DIR}}" \
--no-typescript \
--out-name {{WASM_NAME}} \
{{CRATE_DIR}} \
-- -Z build-std={{BUILD_STD}} --no-default-features --features {{FEATURES}}
flutter run -d chrome \
--web-header=Cross-Origin-Opener-Policy=same-origin \
--web-header=Cross-Origin-Embedder-Policy=require-corp