|
1 | | -version: "3" |
| 1 | +version: '3' |
| 2 | + |
| 3 | +includes: |
| 4 | + common: ./build/Taskfile.yml |
| 5 | + windows: ./build/windows/Taskfile.yml |
| 6 | + linux: ./build/linux/Taskfile.yml |
2 | 7 |
|
3 | 8 | vars: |
4 | 9 | APP_NAME: "rlbotgui" |
5 | 10 | BIN_DIR: "bin" |
6 | | - VITE_PORT: "{{.WAILS_VITE_PORT | default 9245}}" |
| 11 | + VITE_PORT: '{{.WAILS_VITE_PORT | default 9245}}' |
7 | 12 |
|
8 | 13 | tasks: |
9 | | - ## -------------------------- Build -------------------------- ## |
10 | | - |
11 | 14 | build: |
12 | 15 | summary: Builds the application |
13 | 16 | cmds: |
14 | | - # Build for current OS |
15 | | - - task: build:{{OS}} |
16 | | - |
17 | | - build:go: |
18 | | - summary: Builds the application without frontend |
19 | | - cmds: |
20 | | - # Build for current OS |
21 | | - - task: build:{{OS}}:go |
22 | | - |
23 | | - build:windows:go: |
24 | | - summary: Builds the application without frontend for Windows |
25 | | - deps: |
26 | | - - task: go:mod:tidy |
27 | | - vars: |
28 | | - BUILD_FLAGS: "{{.BUILD_FLAGS}}" |
29 | | - - task: generate:icons |
30 | | - vars: |
31 | | - ARCH: "{{.ARCH}}" |
32 | | - cmds: |
33 | | - - go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/rlbotgui.exe |
34 | | - vars: |
35 | | - BUILD_FLAGS: '{{if ne .DEV "true"}}-tags production -trimpath -ldflags="-w -s -H windowsgui"{{else}}-gcflags=all="-l"{{end}}' |
36 | | - env: |
37 | | - GOOS: windows |
38 | | - CGO_ENABLED: 1 |
39 | | - GOARCH: "{{.ARCH | default ARCH}}" |
40 | | - CC: x86_64-w64-mingw32-gcc |
41 | | - DEV: '{{.DEV | default "true"}}' |
42 | | - |
43 | | - build:windows: |
44 | | - summary: Builds the application for Windows |
45 | | - deps: |
46 | | - - task: build:frontend |
47 | | - vars: |
48 | | - BUILD_FLAGS: "{{.BUILD_FLAGS}}" |
49 | | - cmds: |
50 | | - - task: build:windows:go |
51 | | - |
52 | | - ## ------> Linux <------- |
53 | | - |
54 | | - build:linux:go: |
55 | | - summary: Builds the application without the frontend for Linux |
56 | | - deps: |
57 | | - - task: go:mod:tidy |
58 | | - vars: |
59 | | - BUILD_FLAGS: "{{.BUILD_FLAGS}}" |
60 | | - - task: generate:icons |
61 | | - vars: |
62 | | - ARCH: "{{.ARCH}}" |
63 | | - cmds: |
64 | | - - go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/rlbotgui |
65 | | - vars: |
66 | | - BUILD_FLAGS: '{{if ne .DEV "true"}}-tags production -trimpath -ldflags="-w -s"{{else}}-gcflags=all="-l"{{end}}' |
67 | | - env: |
68 | | - GOOS: linux |
69 | | - CGO_ENABLED: 1 |
70 | | - GOARCH: "{{.ARCH | default ARCH}}" |
71 | | - DEV: '{{.DEV | default "true"}}' |
72 | | - |
73 | | - build:linux: |
74 | | - summary: Builds the application for Linux |
75 | | - deps: |
76 | | - - task: build:frontend |
77 | | - vars: |
78 | | - BUILD_FLAGS: "{{.BUILD_FLAGS}}" |
79 | | - cmds: |
80 | | - - task: build:linux:go |
81 | | - |
82 | | - ## -------------------------- Misc -------------------------- ## |
83 | | - |
84 | | - generate:icons: |
85 | | - summary: Generates Windows `.ico` file from an image |
86 | | - dir: build |
87 | | - sources: |
88 | | - - "appicon.png" |
89 | | - generates: |
90 | | - - "icon.ico" |
91 | | - cmds: |
92 | | - # Generates both .ico |
93 | | - - wails3 generate icons -input appicon.png -windowsfilename icon.ico |
| 17 | + - task: "{{OS}}:build" |
94 | 18 |
|
95 | | - install:frontend:deps: |
96 | | - summary: Install frontend dependencies |
97 | | - dir: frontend |
98 | | - sources: |
99 | | - - package.json |
100 | | - - package-lock.json |
101 | | - generates: |
102 | | - - node_modules/* |
103 | | - preconditions: |
104 | | - - sh: pnpm version |
105 | | - msg: "Looks like pnpm isn't installed." |
| 19 | + package: |
| 20 | + summary: Packages a production build of the application |
106 | 21 | cmds: |
107 | | - # - npm install --silent --no-progress |
108 | | - - pnpm install |
109 | | - |
110 | | - build:frontend: |
111 | | - summary: Build the frontend project |
112 | | - dir: frontend |
113 | | - sources: |
114 | | - - "**/*" |
115 | | - generates: |
116 | | - - dist/* |
117 | | - deps: |
118 | | - - install:frontend:deps |
119 | | - - task: generate:bindings |
120 | | - vars: |
121 | | - BUILD_FLAGS: "{{.BUILD_FLAGS}}" |
122 | | - cmds: |
123 | | - - pnpm run build # -q |
124 | | - |
125 | | - generate:bindings: |
126 | | - summary: Generates bindings for the frontend |
127 | | - sources: |
128 | | - - "**/*.go" |
129 | | - - go.mod |
130 | | - - go.sum |
131 | | - generates: |
132 | | - - "frontend/bindings/**/*" |
133 | | - cmds: |
134 | | - # For a complete list of options, run `wails3 generate bindings -help` |
135 | | - - wails3 generate bindings -f '{{.BUILD_FLAGS}}' |
136 | | - |
137 | | - go:mod:tidy: |
138 | | - summary: Runs `go mod tidy` |
139 | | - internal: true |
140 | | - generates: |
141 | | - - go.sum |
142 | | - sources: |
143 | | - - go.mod |
144 | | - cmds: |
145 | | - - go mod tidy |
146 | | - |
147 | | - # ----------------------- dev ----------------------- # |
| 22 | + - task: "{{OS}}:package" |
148 | 23 |
|
149 | 24 | run: |
150 | 25 | summary: Runs the application |
151 | 26 | cmds: |
152 | | - - task: run:{{OS}} |
153 | | - |
154 | | - run:windows: |
155 | | - cmds: |
156 | | - - '{{.BIN_DIR}}\\{{.APP_NAME}}.exe' |
157 | | - |
158 | | - run:linux: |
159 | | - cmds: |
160 | | - - "{{.BIN_DIR}}/{{.APP_NAME}}" |
161 | | - |
162 | | - dev:frontend: |
163 | | - summary: Runs the frontend in development mode |
164 | | - dir: frontend |
165 | | - deps: |
166 | | - - task: install:frontend:deps |
167 | | - cmds: |
168 | | - - pnpm run dev --port {{.VITE_PORT}} |
| 27 | + - task: "{{OS}}:run" |
169 | 28 |
|
170 | 29 | dev: |
171 | 30 | summary: Runs the application in development mode |
172 | 31 | cmds: |
173 | | - - wails3 dev -port {{.VITE_PORT}} |
174 | | - |
175 | | - dev:reload: |
176 | | - summary: Reloads the application |
177 | | - cmds: |
178 | | - - task: run |
| 32 | + - wails3 dev -config ./build/config.yml -port {{.VITE_PORT}} |
0 commit comments