Skip to content

Commit 2acfa4c

Browse files
committed
Improved justfile.
1 parent 6ba2317 commit 2acfa4c

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

justfile

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,25 @@
55
# File introduced by: Oleksiy Gapotchenko
66
# Year of introduction: 2025
77

8+
set dotenv-load := true
89
set working-directory := "Source"
9-
set unstable := true
10-
11-
# ---------------------------------------------------------------------------
12-
# Shells & Interpreters
13-
# ---------------------------------------------------------------------------
14-
1510
set windows-shell := ["powershell", "-c"]
1611
set script-interpreter := ["gnu-tk", "-i", "-l", "/bin/sh", "-eu"]
1712

18-
# ---------------------------------------------------------------------------
19-
# Configuration
2013
# ---------------------------------------------------------------------------
2114

22-
set dotenv-load := true
23-
24-
dotnet-framework := "net9.0"
15+
dotnet-target-framework := "net9.0"
2516

26-
# ---------------------------------------------------------------------------
27-
# Recipes
2817
# ---------------------------------------------------------------------------
2918

3019
# Show the help for this justfile
3120
@help:
3221
just --list
3322

23+
# ---------------------------------------------------------------------------
24+
# Development
25+
# ---------------------------------------------------------------------------
26+
3427
# Start IDE using the project environment
3528
[group("development")]
3629
[windows]
@@ -79,6 +72,10 @@ check:
7972
echo 'Checking **/*.sh...'
8073
fd -e sh -x shellcheck
8174

75+
# ---------------------------------------------------------------------------
76+
# Build
77+
# ---------------------------------------------------------------------------
78+
8279
# Build release artifacts
8380
[group("build")]
8481
build:
@@ -100,7 +97,7 @@ clean:
10097
# Run all tests
10198
[group("diagnostics")]
10299
test: build
103-
dotnet test -c Release -f "{{ dotnet-framework }}"
100+
dotnet test -c Release -f "{{ dotnet-target-framework }}"
104101

105102
# Produce publishable artifacts
106103
[group("build")]
@@ -114,18 +111,17 @@ platform-build: _build-aot _build-setup
114111

115112
[linux]
116113
_build-aot:
117-
if [ "$(uname -m)" = "x86_64" ]; then cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r linux-x64 -f "{{ dotnet-framework }}"; fi
118-
if [ "$(uname -m)" = "aarch64" ]; then cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r linux-arm64 -f "{{ dotnet-framework }}"; fi
114+
if [ "$(uname -m)" = "x86_64" ]; then just _build-aot-arch linux-x64; fi
115+
if [ "$(uname -m)" = "aarch64" ]; then just _build-aot-arch linux-arm64; fi
119116

120117
[windows]
121-
_build-aot:
122-
cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r win-x64 -f "{{ dotnet-framework }}"
123-
cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r win-arm64 -f "{{ dotnet-framework }}"
118+
_build-aot: (_build-aot-arch "win-x64") (_build-aot-arch "win-arm64")
124119

125120
[macos]
126-
_build-aot:
127-
cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r osx-arm64 -f "{{ dotnet-framework }}"
128-
cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r osx-x64 -f "{{ dotnet-framework }}"
121+
_build-aot: (_build-aot-arch "osx-arm64") (_build-aot-arch "osx-x64")
122+
123+
_build-aot-arch rid:
124+
cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r "{{ rid }}" -f "{{ dotnet-target-framework }}"
129125

130126
_build-setup:
131127
cd Setup; just build
@@ -135,8 +131,12 @@ _build-setup:
135131
platform-publish:
136132
cd Packaging; just pack
137133

134+
# ---------------------------------------------------------------------------
135+
# Diagnostics
136+
# ---------------------------------------------------------------------------
137+
138138
# Run GNU-TK from the source code
139139
[group("diagnostics")]
140140
[no-cd]
141141
gnu-tk *args:
142-
dotnet run --project "{{ absolute_path("Gapotchenko.GnuTK") }}" -c Release -f "{{ dotnet-framework }}" --no-launch-profile -v q -- {{ args }}
142+
dotnet run --project "{{ absolute_path("Gapotchenko.GnuTK") }}" -c Release -f "{{ dotnet-target-framework }}" --no-launch-profile -v q -- {{ args }}

0 commit comments

Comments
 (0)