A general ECS generation for Golang game engines
- Go Template 63%
- Go 35.4%
- Shell 1.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
The repository could not build from a clone, for two reasons that only show up together. Every -generated.go file is gitignored, which is right — it is output. But ecs/custom.go was the one tracked file in that package, and it implements two hooks the rendering template calls (DrawSimpleImage, FlushDraws) that the schema cannot describe. So the committed tree contained a file referring to generated types that were not there, and go build failed on a package that cannot exist in a checkout. The generator also could not fill the gap, because it assumed its output directory already existed: os.Create on ecs/types-generated.go without ecs/ returns "no such file or directory". A clone has no ecs/ at all — git does not track empty directories — so the first generate failed too. Both are fixed: - ecs/custom.go and cmd/test/main.go moved to _playground/, which the Go tool ignores because of the leading underscore. They are kept as the reference for reproducing the experiment, with a readme explaining the hooks, and the directory is never compiled. - GenerateFiles now creates the output directory before writing into it. - btest.sh does the full reproduction: build the generator, regenerate, restore the hook file from _playground/, build the generated package and the module. - .gitignore covers ecs/custom.go, which is now a copy rather than a source. Verified from a tree containing no ecs/ directory and no generated files: go build, go vet and go test pass, and ./btest.sh regenerates and builds the generated package. This is the playground the ecs experiment lived in, not production code; the module that ships is the generator. |
||
| _playground | ||
| templates | ||
| testdata | ||
| .gitignore | ||
| btest.sh | ||
| check.go | ||
| combo.go | ||
| ecs.yaml | ||
| file.go | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| names.go | ||
| schema-fill.go | ||
| schema.go | ||
| template.go | ||