-
Notifications
You must be signed in to change notification settings - Fork 7
/
Taskfile.yml
108 lines (89 loc) · 2.1 KB
/
Taskfile.yml
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
108
version: "3"
tasks:
init:
- echo "init"
# 初始化目录, 自动生成多语言空模板文件
init:i18n:
cmds:
- mkdir locales/
- RUST_BACKTRACE=1 cargo i18n
dir: "src-tauri"
ignore_error: true
dev:
cmds:
- echo "dev install"
- cargo install cargo-edit
- cargo install cargo-outdated
- cargo install rust-i18n
- cargo install tauri-cli
dev:fe:
cmds:
- pnpm i -D vue-router@4
- pnpm i -D unplugin-vue-components
- pnpm i -D naive-ui
- pnpm i -D vfonts
- pnpm i -D @vicons/ionicons5
install:
cmds:
- pnpm i
- task: build
run:
cmds:
- pnpm dev
run:rs:
cmds:
- cargo tauri dev -h
- RUST_BACKTRACE=1 RUST_LOG=debug RUSTFLAGS="--cfg tokio_unstable" cargo tauri dev --no-watch # 不自动 watch 文件修改
dir: "src-tauri"
build:
cmds:
- task: update
# - RUST_I18N_DEBUG=1 cargo build
- cargo build
dir: "src-tauri"
# 创建 migrations/
migrate:add:
cmds:
- sqlx migrate add init # 生成 db migration 文件, 手动编辑, 再执行 db 表创建+初始化
dir: "src-tauri"
check:
cmds:
- cargo sqlx prepare
- cargo sqlx prepare --check
dir: "src-tauri"
ignore_error: true
kill:
cmds:
- fig run kill-all-processes-at-port --port 7173
test:
cmds:
- echo "test"
# - task: clean:test
- RUST_BACKTRACE=1 RUST_LOG=debug macro_backtrace=1 cargo test -- --nocapture
dir: "src-tauri"
update:
cmds:
- cargo outdated # RUST_BACKTRACE=1 RUST_LOG=debug
- cargo upgrade # RUST_BACKTRACE=1 RUST_LOG=debug
dir: "src-tauri"
clean:
cmds:
- cargo clean
dir: "src-tauri"
clean:test:
cmds:
- rm *.db
dir: "src-tauri/tmp"
ignore_error: true
release:
cmds:
- echo "release"
- pnpm build
# generate app icon
icon:
cmds:
# - pnpm add -D @tauri-apps/cli
- pnpm tauri icon ./public/img_2.png
fix:
cmds:
- cargo metadata --verbose --format-version 1 --all-features