-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathjustfile
More file actions
84 lines (73 loc) · 3.07 KB
/
Copy pathjustfile
File metadata and controls
84 lines (73 loc) · 3.07 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
_default:
@just --list
# Cleans the project.
clean:
./gradlew clean
# Builds the project.
build:
./gradlew build
# Runs the tests.
test:
./gradlew test
## Runs the hot reload for Kotlin files.
#hotreload:
# ./gradlew compileKotlin --continuous -Dorg.gradle.continuous.quietperiod=100
# Make NEW thumbnails (restores git state!).
[group('docs')]
thumbs:
fd -g '*.png' arts/* -x magick {} -thumbnail 240x240 -unsharp 0x0.75+0.75+0.008 {.}_thumb.png
rm arts/z/etc/*_thumb.png
git restore .
# Generates README file.
[group('docs')]
readme:
./gradlew :example:run
# Dev session: continuous compile + classloader-based hot restart.
# Usage: just dev work work.cosmic.CosmicTopoKt
# Usage: just dev arts:flowforce monolith.MonolithKt
[group('dev')]
dev module main:
#!/usr/bin/env bash
set -e
GRADLE_PROJECT=":{{module}}"
MODULE_DIR="$(echo "{{module}}" | tr ':' '/')"
echo "Building and resolving classpath..."
./gradlew "${GRADLE_PROJECT}:writeLauncherClasspath" "${GRADLE_PROJECT}:classes" -q
SESSION="gart-dev"
LAUNCHER_CP="$(pwd)/${MODULE_DIR}/build/launcher-cp.txt"
CLASSES_DIR="$(pwd)/${MODULE_DIR}/build/classes/kotlin/main"
tmux kill-session -t "$SESSION" 2>/dev/null || true
tmux new-session -d -s "$SESSION" -n compile \
"bash -c './gradlew ${GRADLE_PROJECT}:compileKotlin --continuous -Dorg.gradle.continuous.quietperiod=100'"
tmux set-option -t "$SESSION" remain-on-exit on
tmux split-window -t "$SESSION" -h \
"bash -c 'java -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -XX:+UseSerialGC -Xverify:none -Dgart.align=right @${LAUNCHER_CP} dev.oblac.gart.hotreload.GartLauncherKt ${CLASSES_DIR} {{main}}'"
tmux attach -t "$SESSION"
# Stops the dev session.
[group('dev')]
dev-stop:
tmux kill-session -t gart-dev 2>/dev/null || echo "No dev session running."
# Run a sweeper config from work/sweeps/<name>.sweep (brute-force an art over a grid of inputs).
# Every setting lives in the .sweep file (no flags). Usage: just sweep example
[group('dev')]
sweep name:
#!/usr/bin/env bash
set -e
CONFIG="work/sweeps/{{name}}.sweep"
if [ ! -f "$CONFIG" ]; then
if [ -f "{{name}}" ]; then CONFIG="{{name}}"; else
echo "no sweep config '{{name}}' (looked for $CONFIG). available:"
ls work/sweeps/*.sweep 2>/dev/null | sed 's#work/sweeps/##; s#\.sweep##; s#^# #' || echo " (none yet - add work/sweeps/<name>.sweep)"
exit 1
fi
fi
# renders run on the art's own module classpath, so build whatever 'module = ...' names
# (default: work, where the sweeper itself lives).
MODULE="$(sed -n 's/^[[:space:]]*module[[:space:]]*=[[:space:]]*\([^#]*\).*/\1/p' "$CONFIG" | head -1 | tr -d '[:space:]')"
MODULE="${MODULE:-work}"
./gradlew :work:classes :work:writeClasspath ":${MODULE}:classes" ":${MODULE}:writeClasspath" -q
java @work/build/classpath.txt work.sweeper.SweeperKt "$CONFIG"
# Ink profile of a render, for comparing against a reference.
[group('dev')]
ink png threshold="45":
python3 work/tools/inkprofile.py {{png}} {{threshold}}