-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
143 lines (116 loc) · 3.85 KB
/
justfile
File metadata and controls
143 lines (116 loc) · 3.85 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Gapotchenko.GnuTK
#
# Copyright © Gapotchenko and Contributors
#
# File introduced by: Oleksiy Gapotchenko
# Year of introduction: 2025
set dotenv-load := true
set working-directory := "Source"
set windows-shell := ["powershell", "-c"]
set script-interpreter := ["gnu-tk", "-i", "-l", "/bin/sh", "-eu"]
dotnet-tfm := "net10.0"
# -----------------------------------------------------------------------------
# Show the help for this justfile
@help:
just --list
# -----------------------------------------------------------------------------
# Development
# -----------------------------------------------------------------------------
# Start IDE using the project environment
[group("development")]
[windows]
develop:
@Start-Process (Get-ChildItem -Path . -Filter *.slnx | Select-Object -First 1).FullName
# Start IDE using the project environment
[group("development")]
[unix]
develop:
open *.slnx
# Install development prerequisites
[group("development")]
[script]
prerequisites:
go install github.com/sibprogrammer/xq@latest
npm install -g prettier
go install mvdan.cc/sh/v3/cmd/shfmt@latest
# Prerequisites dependent on a particular GNU toolkit
if [ -n "${GNU_TK_MSYS2_REPOSITORY_PREFIX-}" ]; then
pacman -S --needed --noconfirm "${GNU_TK_MSYS2_REPOSITORY_PREFIX}fd"
pacman -S --needed --noconfirm moreutils
fi
# Format source code
[group("development")]
[script]
[working-directory("..")]
format:
prettier --write "**/*.{js,ts,json,md,yml}"
echo 'Formatting **/*.sh...'
fd -e sh -x shfmt -i 4 -l -w
echo 'Formatting **/justfile...'
fd --glob justfile -x just --unstable --fmt --justfile
#echo 'Formatting miscellaneous files...'
#(cd Source/Mastering; cat Exclusion.dic | tr '[:upper:]' '[:lower:]' | sort -u | sponge Exclusion.dic)
# Check source code
[group("development")]
[script]
check:
echo 'Checking **/*.sh...'
fd -e sh -x shellcheck
# -----------------------------------------------------------------------------
# Build
# -----------------------------------------------------------------------------
# Build release artifacts
[group("build")]
build:
dotnet build -c Release
# Rebuild release artifacts
[group("build")]
rebuild:
dotnet build --no-incremental -c Release
# Clean all artifacts
[group("build")]
clean:
dotnet clean -c Debug
dotnet clean -c Release
cd Deployment; just clean
# Produce publishable artifacts
[group("build")]
publish: _prepare-mastering
dotnet clean -c Release
dotnet pack -c Release -p:TargetFormFactor=NuGet
# Build platform-dependent release artifacts
[group("build")]
platform-build: _prepare-mastering _build-aot _build-setup
[linux]
_build-aot:
if [ "$(uname -m)" = "x86_64" ]; then just _build-aot-arch linux-x64; fi
if [ "$(uname -m)" = "aarch64" ]; then just _build-aot-arch linux-arm64; fi
[windows]
_build-aot: (_build-aot-arch "win-x64") (_build-aot-arch "win-arm64")
[macos]
_build-aot: (_build-aot-arch "osx-arm64") (_build-aot-arch "osx-x64")
_build-aot-arch rid:
cd Gapotchenko.GnuTK; dotnet publish -c Release -p:PublishAot=true -r "{{ rid }}" -f "{{ dotnet-tfm }}"
_build-setup:
cd Deployment/Setup; just build
# Produce platform-dependent publishable artifacts
[group("build")]
platform-publish:
cd Deployment/Packaging; just pack
[windows]
_prepare-mastering:
[unix]
_prepare-mastering:
cd Mastering/Shell; chmod +x *.sh
# -----------------------------------------------------------------------------
# Diagnostics
# -----------------------------------------------------------------------------
# Run all tests
[group("diagnostics")]
test: build
dotnet test -c Release -f "{{ dotnet-tfm }}"
# Run GNU-TK from the source code
[group("diagnostics")]
[no-cd]
gnu-tk *args:
dotnet run --project "{{ absolute_path("Gapotchenko.GnuTK") }}" -c Release -f "{{ dotnet-tfm }}" --no-launch-profile -v q -- {{ args }}