forked from leynier/alera
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
61 lines (49 loc) · 2.81 KB
/
Copy pathmakefile
File metadata and controls
61 lines (49 loc) · 2.81 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
DART ?= dart
CARGO ?= cargo
FLUTTER ?= flutter
APP_DEVICE_ARG = $(if $(APP_DEVICE),--device "$(APP_DEVICE)",)
ALERA_FLAVOR ?= dev
ALERA_APP_ID ?= $(if $(filter release,$(ALERA_FLAVOR)),dev.leynier.alera,dev.leynier.alera.dev)
ALERA_CLI_BUNDLE_DIR ?= .dart_tool/alera
ALERA_CLI_DEBUG_TOKEN ?= dev-token
ALERA_HOST_EMPTY_SHUTDOWN_SECONDS ?= 30
ALERA_HOST_DETACHED_SHUTDOWN_SECONDS ?= 3600
ALERA_HOST_SCROLLBACK_BYTES ?= 10000000
ALERA_DEBUG_TOOL = tool/debug/alera_debug.dart
.PHONY: help update-refs frb-generate rust-test cli-build cli-help host-debug app-debug app-debug-bundled-cli debug-processes host-stop
# List available make targets.
help:
$(DART) $(ALERA_DEBUG_TOOL) help
# Update all reference projects (git submodules) to their latest remote commits
update-refs:
git submodule update --init --recursive --remote --merge
# Regenerate flutter_rust_bridge bindings after changing the Rust API surface
# (rust/src/api). The generated Dart under lib/src/rust is committed.
frb-generate:
flutter_rust_bridge_codegen generate
# Format, lint, and test the Rust workspace (alera_native + alera-cli). The
# `--workspace` flags are required because `rust/` has a root package, so a bare
# clippy/test would only cover `alera_native` and skip the `alera-cli` member.
rust-test:
cd rust && "$(CARGO)" fmt --check && "$(CARGO)" clippy --workspace --all-targets -- -D warnings && "$(CARGO)" test --workspace
# Build the Rust alera CLI sidecar (cargo) used by desktop app launches.
cli-build:
$(DART) $(ALERA_DEBUG_TOOL) cli-build --cargo "$(CARGO)" --bundle-dir "$(ALERA_CLI_BUNDLE_DIR)"
# Smoke-test the locally built Rust CLI sidecar.
cli-help:
$(DART) $(ALERA_DEBUG_TOOL) cli-help --cargo "$(CARGO)" --bundle-dir "$(ALERA_CLI_BUNDLE_DIR)"
# Run the terminal host in the foreground for direct stdout/stderr debugging.
host-debug:
$(DART) $(ALERA_DEBUG_TOOL) host-debug --app-id "$(ALERA_APP_ID)" --debug-token "$(ALERA_CLI_DEBUG_TOKEN)" --host-empty-shutdown-seconds "$(ALERA_HOST_EMPTY_SHUTDOWN_SECONDS)" --host-detached-shutdown-seconds "$(ALERA_HOST_DETACHED_SHUTDOWN_SECONDS)" --host-scrollback-bytes "$(ALERA_HOST_SCROLLBACK_BYTES)"
# Run the Flutter app with the normal development fallback for the CLI.
app-debug:
$(DART) $(ALERA_DEBUG_TOOL) app-debug --flutter "$(FLUTTER)" $(APP_DEVICE_ARG) --alera-flavor "$(ALERA_FLAVOR)"
# Run the Flutter app against the locally compiled CLI bundle.
app-debug-bundled-cli:
$(DART) $(ALERA_DEBUG_TOOL) app-debug-bundled-cli --flutter "$(FLUTTER)" $(APP_DEVICE_ARG) --alera-flavor "$(ALERA_FLAVOR)" --bundle-dir "$(ALERA_CLI_BUNDLE_DIR)"
# Inspect running Alera app and terminal-host processes.
debug-processes:
$(DART) $(ALERA_DEBUG_TOOL) debug-processes --app-id "$(ALERA_APP_ID)"
# Stop the current debug terminal host for this app id.
host-stop:
$(DART) $(ALERA_DEBUG_TOOL) host-stop --app-id "$(ALERA_APP_ID)"