nandi/vflutter_ffipublic Fork 0
f7c3825dc671305345e20a62ea6ac8facbc903bb
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.

Add a justfile f7c3825 · on f7c3825dc671305345e20a62ea6ac8facbc903bb · nandithebull · 3h ago
justfile · 54 lines · 1.7 KBMakefile Blame HistoryRaw
 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
# vflutter_ffi — V logic, Flutter front end.
#
# Flutter is not assumed to be on PATH: set FLUTTER_BIN if yours lives
# somewhere other than ~/flutter/bin.

flutter_bin := env_var_or_default("FLUTTER_BIN", env_var("HOME") / "flutter/bin")
flutter     := flutter_bin / "flutter"
lib_path    := justfile_directory() / "build"

_default:
    @just --list

# Run the Mandelbrot explorer.
mandelbrot: build
    cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} run -d linux

# Alias: the example app is the Mandelbrot explorer.
run: mandelbrot

# Build the host V library into build/ (-gc none -prod) and check its exports.
build:
    ./tool/build.sh

# Compile the V source to C for iOS/macOS. Run after editing src/vflutter.v.
gen-ios:
    ./tool/gen_ios_sources.sh

# Analyze and test the example. Needs the host library for the FFI calls.
test: build
    cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} analyze
    cd example && LD_LIBRARY_PATH="{{lib_path}}" PATH="{{flutter_bin}}:$PATH" {{flutter}} test

# V vs Dart timings for the same frame (AOT, so it matches a release app).
bench: build
    dart compile exe example/lib/fractal_bench.dart -o /tmp/vflutter_bench
    LD_LIBRARY_PATH="{{lib_path}}" /tmp/vflutter_bench

# String round-trip and isolate dispatch. No Flutter SDK required.
smoke: build
    LD_LIBRARY_PATH="{{lib_path}}" dart example/lib/main_test.dart

# RSS regression guard for the -gc none ownership rule. No Flutter SDK required.
memcheck: build
    LD_LIBRARY_PATH="{{lib_path}}" dart example/lib/memory_check.dart

# Release build of the example.
release: build
    cd example && PATH="{{flutter_bin}}:$PATH" {{flutter}} build linux --release

# Everything CI would run.
ci: build smoke memcheck test bench

clean:
    rm -rf build example/build