Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
76 lines (67 loc) · 2.62 KB
/
Copy pathTaskfile.yml
File metadata and controls
76 lines (67 loc) · 2.62 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: '3'
vars:
APP_NAME: "coolssh"
# The name people see and search for; `info.productName` in build/config.yml carries the same.
PRODUCT_NAME: "CoolSSH"
BIN_DIR: "bin"
WAILS_VITE_PORT: '{{.WAILS_VITE_PORT | default 9245}}'
# The host OS unless `go tool wails3 build GOOS=...` cross-compiles.
GOOS: '{{.GOOS | default OS}}'
STATICCHECK: go run honnef.co/go/tools/cmd/staticcheck@v0.8.1
GOCOGNIT: go run github.com/uudashr/gocognit/cmd/gocognit@v1.2.2
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 app for the target OS
cmds:
- task: "{{.GOOS}}:build"
package:
summary: Packages a production build for the target OS
cmds:
- task: "{{.GOOS}}:package"
run:
summary: Runs the built app
cmds:
- task: "{{.GOOS}}:run"
dev:
summary: Runs the app with the frontend's development server
cmds:
- go tool wails3 dev -config ./build/config.yml -port {{.WAILS_VITE_PORT}}
icons:
summary: Renders every platform icon from build/appicon.icon
cmds:
- task: common:render:icons
check:
summary: Runs every gate
deps:
- task: common:install:frontend:deps
# The macOS target the app builds for, so the linker does not warn about newer objects.
env:
CGO_CFLAGS: '{{if eq OS "darwin"}}-mmacosx-version-min=13.0{{end}}'
CGO_LDFLAGS: '{{if eq OS "darwin"}}-mmacosx-version-min=13.0{{end}}'
MACOSX_DEPLOYMENT_TARGET: '{{if eq OS "darwin"}}13.0{{end}}'
cmds:
- task: common:build:frontend
- cd frontend && pnpm lint
- cd frontend && pnpm typecheck
- cd frontend && pnpm test
- task: bindings:fresh
- cd frontend && pnpm exec jscpd ..
- test -z "$(gofmt -l $(git ls-files --cached --others --exclude-standard '*.go'))"
- go vet ./...
- "{{.STATICCHECK}} ./..."
- "{{.GOCOGNIT}} -over $(node -p \"require('./frontend/biome.json').linter.rules.complexity.noExcessiveCognitiveComplexity.options.maxAllowedComplexity\") $(git ls-files --cached --others --exclude-standard '*.go')"
- go test -race ./...
bindings:fresh:
summary: Fails when frontend/bindings differs from what the Go service generates
internal: true
cmds:
- |
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
go tool wails3 generate bindings -ts -i -d "$scratch" > /dev/null
diff -r "$scratch" frontend/bindings > /dev/null || { echo "frontend/bindings is stale; run go tool wails3 task common:generate:bindings"; exit 1; }