nandi/vflutter_ffipublic Fork 0
728acaab2594667f4998fc18812e7c1e2e4cc549
Commits
Clone
git clone https://git.rickub.com/nandi/vflutter_ffi.git
git clone ssh://git@rickub.com/nandi/vflutter_ffi.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

justfile · 93 lines · 3.2 KBMakefile Blame HistoryRaw
Add a justfile f7c3825 nandithebull yesterday1# vflutter_ffi — V logic, Flutter front end.
2#
3# Flutter is not assumed to be on PATH: set FLUTTER_BIN if yours lives
4# somewhere other than ~/flutter/bin.
5
6flutter_bin := env_var_or_default("FLUTTER_BIN", env_var("HOME") / "flutter/bin")
7flutter := flutter_bin / "flutter"
8lib_path := justfile_directory() / "build"
9
Add a WebAssembly backend for the example 728acaa nandithebull yesterday10# Port for `just web`. Override with WEB_PORT=9000 just web
11web_port := env_var_or_default("WEB_PORT", "8080")
12
Add a justfile f7c3825 nandithebull yesterday13_default:
14 @just --list
15
16# Run the Mandelbrot explorer.
17mandelbrot: build
18 cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} run -d linux
19
20# Alias: the example app is the Mandelbrot explorer.
21run: mandelbrot
22
23# Build the host V library into build/ (-gc none -prod) and check its exports.
24build:
25 ./tool/build.sh
26
27# Compile the V source to C for iOS/macOS. Run after editing src/vflutter.v.
28gen-ios:
29 ./tool/gen_ios_sources.sh
30
Add a WebAssembly backend for the example 728acaa nandithebull yesterday31# emcc is not installed: tool/bin/emcc is a DotSlash file that fetches a
32# content-pinned emscripten on first run and caches it in ~/.cache/dotslash.
33# Only `dotslash` itself needs to be on PATH.
34#
35# Compile the V source to WebAssembly for the web build.
36wasm:
37 ./tool/build_wasm.sh
38
39# Headless check of the wasm module — no browser, no Flutter.
40test-wasm: wasm
41 node tool/test_wasm.mjs
42
43# Same frame from the wasm and native kernels, compared byte for byte.
44parity: build wasm
45 ./tool/check_parity.sh
46
47# Prints a URL and waits; no browser is launched. Hot restart still works
48# (press R). Override the port with WEB_PORT=9000 just web
49#
50# Serve the Mandelbrot explorer, with V running as wasm.
51web: wasm
52 cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} run -d web-server --web-port={{web_port}}
53
54# Release web build of the example. Output: example/build/web/
55build-web: wasm
56 cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} build web --release
57
58# Load the built web app in headless Chrome and assert V drew a real frame.
59check-web: build-web
60 ./tool/check_web.sh
61
Add a justfile f7c3825 nandithebull yesterday62# Analyze and test the example. Needs the host library for the FFI calls.
63test: build
64 cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} analyze
65 cd example && LD_LIBRARY_PATH="{{lib_path}}" PATH="{{flutter_bin}}:$PATH" {{flutter}} test
66
67# V vs Dart timings for the same frame (AOT, so it matches a release app).
68bench: build
69 dart compile exe example/lib/fractal_bench.dart -o /tmp/vflutter_bench
70 LD_LIBRARY_PATH="{{lib_path}}" /tmp/vflutter_bench
71
Raise the isolate ceiling to 32, and add the sweep that justifies it 59a731a nandithebull yesterday72# Sweep the isolate count to find the best band split for this machine.
73sweep: build
74 dart compile exe example/lib/tile_sweep.dart -o /tmp/vflutter_sweep
75 LD_LIBRARY_PATH="{{lib_path}}" /tmp/vflutter_sweep
76
Add a justfile f7c3825 nandithebull yesterday77# String round-trip and isolate dispatch. No Flutter SDK required.
78smoke: build
79 LD_LIBRARY_PATH="{{lib_path}}" dart example/lib/main_test.dart
80
81# RSS regression guard for the -gc none ownership rule. No Flutter SDK required.
82memcheck: build
83 LD_LIBRARY_PATH="{{lib_path}}" dart example/lib/memory_check.dart
84
85# Release build of the example.
86release: build
87 cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} build linux --release
88
89# Everything CI would run.
Add a WebAssembly backend for the example 728acaa nandithebull yesterday90ci: build smoke memcheck test bench test-wasm parity check-web
Add a justfile f7c3825 nandithebull yesterday91
92clean:
Add a WebAssembly backend for the example 728acaa nandithebull yesterday93 rm -rf build example/build example/web/vflutter.js example/web/vflutter.wasm