-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
executable file
·77 lines (58 loc) · 2.28 KB
/
Copy pathjustfile
File metadata and controls
executable file
·77 lines (58 loc) · 2.28 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
#!/usr/bin/env just --justfile
# -----------------------------------------------------------------------------
# VERSIONING:
# -----------------------------------------------------------------------------
export JAVA_VERSION := "27"
export TARGET_OPENJDK_TAG := "jdk-27+0"
# -----------------------------------------------------------------------------
# TARGETS:
# -----------------------------------------------------------------------------
PROJECT_ROOT := justfile_directory()
PYTHON_VENV := PROJECT_ROOT / ".venv"
GENERATED_DIR := PROJECT_ROOT / "generated"
BUILD_DIR := PROJECT_ROOT / "build"
DIST_DIR := BUILD_DIR / "dist"
OUT_DIR := BUILD_DIR / "out"
default: debug
# Clean up all build artifacts
clean:
cargo clean
rm -r {{ DIST_DIR }} {{ OUT_DIR }} {{ GENERATED_DIR }}
# Run `cargo test`
test *ARGS: debug
just dist --profile debug
JAVA_HOME={{ DIST_DIR }} cargo +nightly -Z unstable-options test {{ ARGS }}
# Run `cargo clippy`
lint *ARGS:
cargo +nightly -Z unstable-options clippy {{ ARGS }}
# Run `cargo doc`
doc *ARGS:
cargo +nightly -Z unstable-options doc {{ ARGS }}
# Build the entire project in debug
debug:
cargo +nightly -Z unstable-options build --workspace
# Build the entire project in release
release:
cargo +nightly -Z unstable-options build --release --workspace
native-debug:
cargo +nightly -Z unstable-options build -p native-meta
native-release:
cargo +nightly -Z unstable-options build --release -p native-meta
native: native-debug
dist *ARGS:
PYTHONPATH={{ PROJECT_ROOT }} python3 {{ BUILD_DIR }}/entry.py {{ ARGS }}
_venv:
python -m venv {{ PYTHON_VENV }}
{{ PYTHON_VENV }}/bin/python -m pip install --upgrade pip
{{ PYTHON_VENV }}/bin/python -m pip install -r {{ PROJECT_ROOT }}/scripts/requirements.txt
script name *ARGS: _venv
{{ PYTHON_VENV }}/bin/python {{ PROJECT_ROOT }}/scripts/{{ name }}.py {{ ARGS }}
# Build and run the java binary with the provided arguments
java +ARGS: release
just _do_java release {{ ARGS }}
# Build and run the java binary in debug mode with the provided arguments
java-debug +ARGS: debug
just _do_java debug {{ ARGS }}
_do_java PROFILE +ARGS:
just dist --profile {{ PROFILE }}
JAVA_HOME={{ DIST_DIR }} {{ DIST_DIR / "bin" / "java" }} -Djava.home={{ DIST_DIR }} {{ ARGS }}