-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
189 lines (155 loc) · 4.72 KB
/
Taskfile.yml
File metadata and controls
189 lines (155 loc) · 4.72 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
version: 3
dotenv: [".env"]
vars:
LX_LUA_VERSION: "jit"
LX_ARGS: "--lua-version {{ .LX_LUA_VERSION }}"
SRC_PANO_LAYOUTS: '{{ joinPath .ROOT_DIR "content" "panorama" "layout" }}'
SRC_PANO_SCRIPTS: '{{ joinPath .ROOT_DIR "src" "content" "panorama" "scripts" }}'
SRC_PANO_STYLES: '{{ joinPath .ROOT_DIR "src" "content" "panorama" "styles" }}'
SRC_VSCRIPTS: '{{ joinPath .ROOT_DIR "game" "scripts" "vscripts" }}'
SRC_VSCRIPTS_TESTS: '{{ joinPath .ROOT_DIR "spec" }}'
SRC_TASKS: '{{ joinPath .ROOT_DIR "src" "tasks" }}'
EMMYLUA_CONFIG: '{{ joinPath .ROOT_DIR ".emmyrc.json" }}'
STYLUA_CONFIG: '{{ joinPath .ROOT_DIR ".stylua.toml" }}'
SELENE_CONFIG: '{{ joinPath .ROOT_DIR "selene.toml" }}'
SELENE_TESTS_CONFIG: '{{ joinPath .SRC_VSCRIPTS_TESTS "selene.toml" }}'
TASKS_ENTRYPOINT: '{{ joinPath .SRC_TASKS "main.ts" }}'
TASKS_RUN: 'bun run -- "{{ .TASKS_ENTRYPOINT }}"'
tasks:
default:
cmds:
- task: format
- task: lint
- task: test
- task: build
format:
desc: Run all formatters
cmds:
- task: format:tasks
- task: format:vscripts
- task: format:panorama
lint:
desc: Run all linters
cmds:
- task: lint:tasks
- task: lint:vscripts
- task: lint:panorama
test:
desc: Run all tests
cmds:
- task: test:vscripts
clean:
desc: Remove all compiled, generated and linked files
cmd: "{{ .TASKS_RUN }} clean {{ .CLI_ARGS }}"
link:
desc: Link source files to game directories
cmd: "{{ .TASKS_RUN }} link {{ .CLI_ARGS }}"
launch:game:
desc: Launch Dota2
cmd: "{{ .TASKS_RUN }} launch {{ .CLI_ARGS }} game"
launch:sdk:
desc: Launch SDK (Workshop Tools)
cmd: "{{ .TASKS_RUN }} launch {{ .CLI_ARGS }} sdk"
_build:
internal: true
cmd: "{{ .TASKS_RUN }} build {{ .CLI_ARGS }} {{ .ARGS }}"
build:
desc: Build everything
cmd: { task: "_build" }
build:pano:scripts:
desc: Build panorama scripts
cmds:
- task: "_build"
vars: { ARGS: "scripts" }
build:pano:styles:
desc: Build panorama styles
cmds:
- task: "_build"
vars: { ARGS: "styles" }
_compile:
internal: true
cmd: "{{ .TASKS_RUN }} compile {{ .CLI_ARGS }} {{ .ARGS }}"
compile:
desc: Compile everything
deps: [build]
cmds:
- task: "_compile"
compile:maps:
desc: Compile maps
cmds:
- task: "_compile"
vars: { ARGS: "maps" }
compile:panorama:
desc: Compile all panorama resources
cmds:
- task: "_compile"
vars: { ARGS: "panorama" }
compile:pano:scripts:
desc: Compile panorama scripts
cmds:
- task: "build:pano:scripts"
- task: "_compile"
vars: { ARGS: "scripts" }
compile:pano:styles:
desc: Compile panorama styles
cmds:
- task: "build:pano:styles"
- task: "_compile"
vars: { ARGS: "styles" }
compile:resources:
desc: Compile resources
cmds:
- task: "_compile"
vars: { ARGS: "resources" }
format:vscripts:
desc: Format vscripts
cmd: stylua --verify --config-path "{{ .STYLUA_CONFIG }}" "{{ .SRC_VSCRIPTS }}"
lint:vscripts:
desc: Lint vscripts
cmds:
- emmylua_check --config "{{ .EMMYLUA_CONFIG }}" "{{ .ROOT_DIR }}"
- selene --config "{{ .SELENE_CONFIG }}" "{{ .SRC_VSCRIPTS }}"
- selene --config "{{ .SELENE_TESTS_CONFIG }}" "{{ .SRC_VSCRIPTS_TESTS }}"
test:vscripts:
desc: Test vscripts
cmd: lx {{ .LX_ARGS }} test -- {{ .CLI_ARGS }}
format:panorama:
desc: Format all panorama files
cmds:
- task: format:pano:layouts
- task: format:pano:scripts
- task: format:pano:styles
lint:panorama:
desc: Lint all panorama files
cmds:
- task: lint:pano:layouts
- task: lint:pano:scripts
- task: lint:pano:styles
format:pano:layouts:
desc: Format panorama layouts
cmd: dprint fmt '{{ joinPath .SRC_PANO_LAYOUTS "**" }}'
lint:pano:layouts:
desc: Lint panorama layouts
cmd: echo "not implemented"
format:pano:scripts:
desc: Format panorama scripts
cmd: dprint fmt '{{ joinPath .SRC_PANO_SCRIPTS "**" }}'
lint:pano:scripts:
desc: Lint panorama scripts
dir: "{{ .SRC_PANO_SCRIPTS }}"
cmd: bun x -- "@biomejs/biome" lint {{ .CLI_ARGS }}
format:pano:styles:
desc: Format panorama styles
cmd: dprint fmt '{{ joinPath .SRC_PANO_STYLES "**" }}'
lint:pano:styles:
desc: Lint panorama styles
dir: "{{ .SRC_PANO_STYLES }}"
cmd: echo "not implemented"
# cmd: bun x -- "@biomejs/biome" lint {{ .CLI_ARGS }}
format:tasks:
desc: Format tasks
cmd: dprint fmt '{{ joinPath .SRC_TASKS "**" }}'
lint:tasks:
desc: Lint tasks
dir: "{{ .SRC_TASKS }}"
cmd: bun x -- "@biomejs/biome" lint {{ .CLI_ARGS }}