-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
59 lines (47 loc) · 2.46 KB
/
Copy pathJustfile
File metadata and controls
59 lines (47 loc) · 2.46 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
default:
@just --list
build target:
@case "{{target}}" in \
plugins) just _build_plugins ;; \
stable|beta|nightly) just _build_client "{{target}}" ;; \
*) just _build_usage ;; \
esac
_build_client channel="stable":
npm --prefix Frontend run build
FRONTEND_SKIP_BUILD=1 NO_STRIP=true OPENVCS_UPDATE_CHANNEL={{channel}} node scripts/tauri-build.js
_build_plugins:
@echo "Plugin-only builds are not currently implemented by this Justfile"
_build_usage:
@echo "Unknown build target. Use: just build stable, just build beta, just build nightly, or just build plugins"
@exit 2
test:
cargo test --workspace
cd Frontend && npm exec tsc -- -p tsconfig.json --noEmit
cd Frontend && npx vitest run
coverage-frontend:
npm --prefix Frontend run coverage
coverage-backend:
cargo llvm-cov --workspace --lcov --output-path target/llvm-cov-backend.info --fail-under-lines 95
coverage:
just coverage-backend
just coverage-frontend
tauri-build channel="stable":
FRONTEND_SKIP_BUILD=1 NO_STRIP=true OPENVCS_UPDATE_CHANNEL={{channel}} node scripts/tauri-build.js
flatpak-sources:
# flatpak-node-generator is incomplete on npm lockfile v3; regen temp v2 lockfile first.
set -euo pipefail; python3 -m pip install --user flatpak-cargo-generator flatpak-node-generator; TMPDIR="$(mktemp -d)"; trap 'rm -rf "$TMPDIR"' EXIT; cp Frontend/package.json Frontend/package-lock.json "$TMPDIR"/; (cd "$TMPDIR" && npm install --package-lock-only --lockfile-version 2 --ignore-scripts --no-audit --no-fund >/dev/null); CARGO_GEN="$(python3 -c 'import flatpak_cargo_generator.script; print(flatpak_cargo_generator.script.__file__)')"; python3 "$CARGO_GEN" Cargo.lock -o ../flathub/cargo-sources.json; python3 -m flatpak_node_generator npm "$TMPDIR/package-lock.json" -o ../flathub/npm-sources-frontend.json
# Requires Open-VCS/flathub cloned as a sibling directory: git clone git@github.com:Open-VCS/flathub.git ../flathub
build-flatpak install="":
just flatpak-sources
@if [ "{{install}}" = "-i" ]; then \
flatpak-builder --force-clean --user --install build-flatpak ../flathub/app.openvcs.OpenVCS.yml; \
elif [ -n "{{install}}" ]; then \
echo "Usage: just build-flatpak [-i]"; \
exit 2; \
else \
flatpak-builder --force-clean --user build-flatpak ../flathub/app.openvcs.OpenVCS.yml; \
fi
fix:
cargo fmt --all
cargo clippy --fix --all-targets --all-features --allow-dirty --allow-staged
cd Frontend && npm exec tsc -- -p tsconfig.json --noEmit || true