-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjustfile
More file actions
72 lines (62 loc) · 2.74 KB
/
justfile
File metadata and controls
72 lines (62 loc) · 2.74 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
_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!).
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.
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
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"
# Dev session using entr to restart the JVM on class changes (fallback).
dev-entr module main:
#!/usr/bin/env bash
set -e
GRADLE_PROJECT=":{{module}}"
MODULE_DIR="$(echo "{{module}}" | tr ':' '/')"
echo "Building and resolving classpath..."
./gradlew "${GRADLE_PROJECT}:writeClasspath" "${GRADLE_PROJECT}:classes" -q
SESSION="gart-dev"
CP_FILE="$(pwd)/${MODULE_DIR}/build/classpath.txt"
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 'while true; do find ${MODULE_DIR}/build/classes -name \"*.class\" | entr -d -r java -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -XX:+UseSerialGC -Xverify:none -Dgart.align=right @${CP_FILE} {{main}}; done'"
tmux attach -t "$SESSION"
# Stops the dev session.
dev-stop:
tmux kill-session -t gart-dev 2>/dev/null || echo "No dev session running."