-
Notifications
You must be signed in to change notification settings - Fork 834
Expand file tree
/
Copy pathjustfile
More file actions
101 lines (85 loc) · 3.45 KB
/
Copy pathjustfile
File metadata and controls
101 lines (85 loc) · 3.45 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
# Zeal dev and release recipes.
# Uses CMake presets defined in CMakePresets.json.
# Run `just` (no args) to see the recipe list.
set shell := ["bash", "-cu"]
set windows-shell := ["sh", "-cu"]
set positional-arguments
# Default build preset; override with `just preset=name <recipe>`.
preset := env_var_or_default("PRESET", "dev")
# OS-specific preset selector for the build-time profiler.
timetrace_preset := if os() == "windows" { "timetrace-windows" } else { "timetrace-unix" }
[private]
default:
@just --list
# Configure a build directory using the current preset.
[group('dev')]
configure *args:
cmake --preset {{preset}} "$@"
# Build using the current preset.
[group('dev')]
build:
cmake --build --preset {{preset}}
# Build and run Zeal; args go to zeal.
[group('dev')]
run *args: build
./build/{{preset}}/zeal "$@"
# Configure, build, and run the test suite.
[group('dev')]
test:
cmake --preset testing
cmake --build --preset testing
ctest --preset testing
# Run clang-format over the tree.
[group('dev')]
format *args:
pwsh tools/run-clang-format.ps1 {{args}}
# Depends on `build` so AUTOUIC/AUTOMOC/AUTORCC headers exist.
# Run clang-tidy over the tree or given files.
[group('dev')]
lint *args: build
pwsh tools/run-clang-tidy.ps1 {{args}}
# Run clazy Qt-aware checks.
[group('dev')]
clazy *args: build
pwsh tools/run-clazy.ps1 {{args}}
# Requires Clang (clang-cl on Windows) and ClangBuildAnalyzer on PATH.
# Profile build time and emit a ClangBuildAnalyzer report.
[group('dev')]
analyze-build-time:
cmake --preset {{timetrace_preset}}
cmake --build --preset {{timetrace_preset}}
ClangBuildAnalyzer --all build/{{timetrace_preset}} build/{{timetrace_preset}}/cba.bin
ClangBuildAnalyzer --analyze build/{{timetrace_preset}}/cba.bin
# Re-emit the ClangBuildAnalyzer report from an existing timetrace build.
[group('dev')]
analyze-build-time-report:
ClangBuildAnalyzer --analyze build/{{timetrace_preset}}/cba.bin
# Invoke the preset's clean target.
[group('dev')]
clean:
cmake --build --preset {{preset}} --target clean
# Generate release notes for the given version, insert the corresponding
# <release> entry into the appdata, and bump CMakeLists.txt versions.
# Review the resulting changes with `git diff` before running `just release-push`.
# Maintainer use only.
[group('release')]
release-prepare version:
bash tools/release-prepare.sh {{version}}
# Commit appdata + version bump, push, create the draft release with the
# generated notes, then tag and push the tag (which triggers build CI).
# The actual GitHub Publish click still happens manually in the UI.
# `remote` controls which remote (and matching GitHub repo) receives the push;
# default is `origin` (works for fork testing). For an upstream release, run
# `just release-push 0.8.2 upstream` (or whatever you've named the upstream remote).
# Maintainer use only.
[group('release')]
release-push version remote="origin":
git add assets/freedesktop/org.zealdocs.zeal.appdata.xml.in CMakeLists.txt
git commit -m "chore: release v{{version}}"
git push {{remote}} HEAD
gh release create v{{version}} --draft --notes-file build/release-notes.md \
--repo "$(git remote get-url {{remote}} | sed -E 's|^.*github\.com[:/]||; s|\.git$||')"
git tag v{{version}}
git push {{remote}} v{{version}}
@echo "Pushed v{{version}} with draft release. CI will upload artifacts."
@echo "When CI is done, open the draft on GitHub and click Publish."