Files
code-utils/Taskfile.yml
2026-08-15 17:18:00 +08:00

46 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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:
summary: Packages a production build of the application (+ nl-pms-api when changed)
cmds:
- task: api:package
- task: "{{.GOOS}}:package"
# 打包云端 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}}
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}}