2026-08-14 07:52:01 +08:00
|
|
|
|
version: '3'
|
|
|
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
|
APP_NAME: "code-count"
|
|
|
|
|
|
BIN_DIR: "bin"
|
|
|
|
|
|
PACKAGE_MANAGER: '{{.PACKAGE_MANAGER | default "npm"}}'
|
|
|
|
|
|
VITE_PORT: '{{.WAILS_VITE_PORT | default 9245}}'
|
|
|
|
|
|
# Target OS for build/package/run. Defaults to the host OS, and is overridden
|
|
|
|
|
|
# by `wails3 build GOOS=...` (or the GOOS env var) for cross-compilation.
|
|
|
|
|
|
GOOS: '{{.GOOS | default OS}}'
|
|
|
|
|
|
|
|
|
|
|
|
includes:
|
|
|
|
|
|
common: ./build/Taskfile.yml
|
|
|
|
|
|
windows: ./build/windows/Taskfile.yml
|
|
|
|
|
|
darwin: ./build/darwin/Taskfile.yml
|
|
|
|
|
|
linux: ./build/linux/Taskfile.yml
|
|
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
build:
|
|
|
|
|
|
summary: Builds the application
|
|
|
|
|
|
cmds:
|
|
|
|
|
|
- task: "{{.GOOS}}:build"
|
|
|
|
|
|
|
|
|
|
|
|
package:
|
2026-08-15 17:18:00 +08:00
|
|
|
|
summary: Packages a production build of the application (+ nl-pms-api when changed)
|
2026-08-14 07:52:01 +08:00
|
|
|
|
cmds:
|
2026-08-15 17:18:00 +08:00
|
|
|
|
- task: api:package
|
2026-08-14 07:52:01 +08:00
|
|
|
|
- task: "{{.GOOS}}:package"
|
|
|
|
|
|
|
2026-08-15 17:18:00 +08:00
|
|
|
|
# 打包云端 API:源码有改动才重编;FORCE=1 强制。
|
|
|
|
|
|
# 产出 bin/nl-pms-api/(linux/amd64 二进制 + init.sql + migrations + config.example.yaml)
|
|
|
|
|
|
api:package:
|
|
|
|
|
|
summary: Packages nl-pms-api into bin/nl-pms-api (skip if unchanged)
|
|
|
|
|
|
cmds:
|
|
|
|
|
|
- powershell -NoProfile -ExecutionPolicy Bypass -File ./tools/package-api.ps1 {{if eq .FORCE "1"}}-Force{{end}}
|
|
|
|
|
|
|
2026-08-14 07:52:01 +08:00
|
|
|
|
run:
|
|
|
|
|
|
summary: Runs the application
|
|
|
|
|
|
cmds:
|
|
|
|
|
|
- task: "{{.GOOS}}:run"
|
|
|
|
|
|
|
|
|
|
|
|
dev:
|
|
|
|
|
|
summary: Runs the application in development mode
|
|
|
|
|
|
cmds:
|
|
|
|
|
|
- wails3 dev -config ./build/config.yml -port {{.VITE_PORT}}
|