| Add a justfile f7c3825 nandithebull 5h ago | 1 | # 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 | |
| 6 | flutter_bin := env_var_or_default("FLUTTER_BIN", env_var("HOME") / "flutter/bin") |
| 7 | flutter := flutter_bin / "flutter" |
| 8 | lib_path := justfile_directory() / "build" |
| 9 | |
| 10 | _default: |
| 11 | @just --list |
| 12 | |
| 13 | # Run the Mandelbrot explorer. |
| 14 | mandelbrot: build |
| 15 | cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} run -d linux |
| 16 | |
| 17 | # Alias: the example app is the Mandelbrot explorer. |
| 18 | run: mandelbrot |
| 19 | |
| 20 | # Build the host V library into build/ (-gc none -prod) and check its exports. |
| 21 | build: |
| 22 | ./tool/build.sh |
| 23 | |
| 24 | # Compile the V source to C for iOS/macOS. Run after editing src/vflutter.v. |
| 25 | gen-ios: |
| 26 | ./tool/gen_ios_sources.sh |
| 27 | |
| 28 | # Analyze and test the example. Needs the host library for the FFI calls. |
| 29 | test: build |
| 30 | cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} analyze |
| 31 | cd example && LD_LIBRARY_PATH="{{lib_path}}" PATH="{{flutter_bin}}:$PATH" {{flutter}} test |
| 32 | |
| 33 | # V vs Dart timings for the same frame (AOT, so it matches a release app). |
| 34 | bench: build |
| 35 | dart compile exe example/lib/fractal_bench.dart -o /tmp/vflutter_bench |
| 36 | LD_LIBRARY_PATH="{{lib_path}}" /tmp/vflutter_bench |
| 37 | |
| Raise the isolate ceiling to 32, and add the sweep that justifies it 59a731a nandithebull 5h ago | 38 | # Sweep the isolate count to find the best band split for this machine. |
| 39 | sweep: build |
| 40 | dart compile exe example/lib/tile_sweep.dart -o /tmp/vflutter_sweep |
| 41 | LD_LIBRARY_PATH="{{lib_path}}" /tmp/vflutter_sweep |
| 42 | |
| Add a justfile f7c3825 nandithebull 5h ago | 43 | # String round-trip and isolate dispatch. No Flutter SDK required. |
| 44 | smoke: build |
| 45 | LD_LIBRARY_PATH="{{lib_path}}" dart example/lib/main_test.dart |
| 46 | |
| 47 | # RSS regression guard for the -gc none ownership rule. No Flutter SDK required. |
| 48 | memcheck: build |
| 49 | LD_LIBRARY_PATH="{{lib_path}}" dart example/lib/memory_check.dart |
| 50 | |
| 51 | # Release build of the example. |
| 52 | release: build |
| 53 | cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} build linux --release |
| 54 | |
| 55 | # Everything CI would run. |
| 56 | ci: build smoke memcheck test bench |
| 57 | |
| 58 | clean: |
| 59 | rm -rf build example/build |