-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathJustfile
More file actions
107 lines (90 loc) · 2.95 KB
/
Justfile
File metadata and controls
107 lines (90 loc) · 2.95 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
# SPDX-FileCopyrightText: <Your Name>
#
# SPDX-License-Identifier: MIT
export QT_QPA_PLATFORM := 'offscreen'
export QT_QUICK_CONTROLS_MATERIAL_VARIANT := 'Dense'
export QT_QUICK_CONTROLS_STYLE := 'Material'
@_default:
just --list
# Initialize repository
[group('build')]
@init ARGS='--group dev':
uv sync {{ ARGS }}
# Build full project into build/release
[group('build')]
@build: clean
just build-develop
mkdir -p build/release
cp -r src build/release
cp main.py build/release
cp rc_project.py build/release
# Build and compile resources into source directory
[group('build')]
@build-develop: _update_pyproject_file
uv run pyside6-project build
# Remove ALL generated files
[group('build')]
@clean:
find i18n -name "*.qm" -type f -delete
rm -rf build pyobjects test/rc_project.py rc_project.py project.json project.qrc
# Add language; pattern: language-region ISO 639-1, ISO 3166-1; example: fr-FR
[group('i18n')]
@add-translation locale: _update_pyproject_file
uv run pyside6-lupdate -source-language en-US -target-language {{ locale }} -ts i18n/{{ locale }}.ts
just update-translations
# Update *.ts files by traversing the source code
[group('i18n')]
@update-translations: _update_pyproject_file _update_lupdate_project_file
uv run pyside6-lupdate -locations none -project project.json
# Run Python and QML tests
[group('test')]
@test: test-python test-qml
# Run Python tests
[group('test')]
@test-python: _prepare-tests
rm -f test/rc_project.py
cp rc_project.py test/rc_project.py
uv run pytest build-aux test
# Run QML tests
[group('test')]
test-qml: _prepare-tests
#!/usr/bin/env bash
uv run python -c '
import sys
from PySide6.QtQuickTest import QUICK_TEST_MAIN_WITH_SETUP
from test.prepare_qml import MyTestSetup
# Pass additional arguments to qmltestrunner:
sys.argv += ["-silent"]
sys.argv += ["-input", "qt/qml"]
# sys.argv += ["-eventdelay", "50"] # Simulate slower systems
ex = QUICK_TEST_MAIN_WITH_SETUP("qmltestrunner", MyTestSetup, argv=sys.argv)
sys.exit(ex)
'
@_prepare-tests: build-develop
rm -f test/rc_project.py
cp rc_project.py test/rc_project.py
@_update_pyproject_file: _generate-qrc-file
uv run python build-aux/update_pyproject_file.py \
--relative-to . \
--include-directory qt/qml \
--include-directory data \
--include-directory src \
--include-directory i18n \
--include-file main.py \
--include-file project.qrc
@_generate-qrc-file:
uv run python build-aux/generate-qrc-file.py \
--relative-to . \
--include-directory qt/qml \
--include-directory data \
--include-directory i18n \
--out-file project.qrc
@_update_lupdate_project_file:
uv run python build-aux/generate-lupdate-project-file.py \
--relative-to . \
--include-directory qt/qml \
--include-directory src \
--include-directory i18n \
--include-file main.py \
--include-file project.qrc \
--out-file project.json