Skip to content

Commit f559fd7

Browse files
committed
Added easyjson generation task in Taskfile
1 parent 84d3769 commit f559fd7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Taskfile.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ tasks:
119119
cmds:
120120
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
121121

122+
go:easyjson-generate:
123+
desc: Run easyjson code generation
124+
cmds:
125+
- go install github.com/mailru/easyjson/...@v0.7.7
126+
- easyjson arduino/cores/packageindex/index.go
127+
- easyjson arduino/libraries/librariesindex/json.go
128+
122129
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
123130
markdown:check-links:
124131
desc: Check for broken links

docs/CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ func main() {
349349
}
350350
```
351351

352+
### About `easyjson` golang library
353+
354+
We use the hi-performance `easyjson` library to parse the large JSON index files for libraries and platforms. To obtain
355+
the best performance we must do some code generation, this is done via `task go:easyjson-generate`. If you ever touch
356+
source code using the `easyjson` library, make sure to re-run the `go:easyjson-generate` task to see if there are
357+
changes in the generated code.
358+
352359
### Additional settings
353360

354361
If you need to push a commit that's only shipping documentation changes or example files, thus a complete no-op for the

0 commit comments

Comments
 (0)