-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
94 lines (76 loc) · 2.77 KB
/
justfile
File metadata and controls
94 lines (76 loc) · 2.77 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Fable.Beam build commands
# Install just: https://github.com/casey/just
set dotenv-load
build_path := "build"
src_path := "src"
test_path := "test"
# Development mode: use local Fable repo instead of dotnet tool
# Usage: just dev=true test
dev := "false"
fable_repo := justfile_directory() / "../fable"
fable := if dev == "true" { "dotnet run --project " + fable_repo / "src/Fable.Cli" + " --" } else { "dotnet fable" }
# Default recipe - show available commands
default:
@just --list
# Clean Fable build output
clean:
rm -rf {{build_path}}
rm -rf {{src_path}}/obj {{src_path}}/bin
rm -rf {{test_path}}/obj {{test_path}}/bin
rm -rf .fable
# Deep clean - removes everything including dotnet obj/bin directories
clean-all: clean
rm -rf {{src_path}}/obj {{test_path}}/obj
rm -rf {{src_path}}/bin {{test_path}}/bin
# Build F# source using dotnet
build:
dotnet build {{src_path}}
# Transpile tests to Erlang and compile with rebar3
build-beam:
dotnet build {{test_path}}
{{fable}} {{test_path}} --lang Erlang --outDir {{build_path}}/tests
cp {{test_path}}/test_runner.erl {{build_path}}/tests/src/
cd {{build_path}}/tests && rebar3 compile
# Run BEAM tests (transpile F# to Erlang, compile, run on BEAM)
test: build-beam
@echo ""
cd {{build_path}}/tests && erl -noshell \
-pa _build/default/lib/fable_beam_test/ebin \
-pa _build/default/lib/fable_library_beam/ebin \
-eval 'test_runner:main(["_build/default/lib/fable_beam_test/ebin"])' \
-s init stop
# Run only the dotnet build (verify F# compiles)
test-dotnet:
dotnet build {{test_path}}
dotnet run --project {{test_path}}
# Create NuGet packages
pack:
dotnet build {{src_path}}
dotnet pack {{src_path}} -c Release
dotnet pack {{src_path}}/cowboy -c Release
# Create NuGet packages with specific version (used in CI)
pack-version version:
dotnet pack {{src_path}} -c Release -p:PackageVersion={{version}} -p:InformationalVersion={{version}}
dotnet pack {{src_path}}/cowboy -c Release -p:PackageVersion={{version}} -p:InformationalVersion={{version}}
# Format code with Fantomas
format:
dotnet fantomas {{src_path}} -r
dotnet fantomas {{test_path}} -r
# Check code formatting without making changes
format-check:
dotnet fantomas {{src_path}} -r --check
dotnet fantomas {{test_path}} -r --check
# Install .NET tools (Fable, Fantomas, etc.)
setup:
dotnet tool restore
# Restore all dependencies
restore:
dotnet paket install
dotnet restore {{src_path}}
dotnet restore {{test_path}}
# Watch for changes and rebuild (useful during development)
watch:
{{fable}} watch {{src_path}} --lang Erlang --outDir {{build_path}}
# Run EasyBuild.ShipIt for release management
shipit *args:
dotnet shipit --pre-release rc {{args}}