A general ECS generation for Golang game engines
  • Go Template 63%
  • Go 35.4%
  • Shell 1.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
surdeus 14e9e8f876 build: make the generator usable from a fresh clone
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.
2026-10-31 15:19:06 +05:00
_playground build: make the generator usable from a fresh clone 2026-10-31 15:19:06 +05:00
templates ... 2026-07-11 13:32:14 +05:00
testdata feat: better resources handling, may have bugs. 2026-07-01 12:54:18 +05:00
.gitignore build: make the generator usable from a fresh clone 2026-10-31 15:19:06 +05:00
btest.sh build: make the generator usable from a fresh clone 2026-10-31 15:19:06 +05:00
check.go feat: implemented type definition through the ecs.yaml 2026-06-30 11:05:16 +05:00
combo.go ... 2026-07-02 15:03:06 +05:00
ecs.yaml feat: added the depth field for rendering and some more checks for the rendering YAML validation. 2026-07-06 06:59:45 +05:00
file.go feat: adding some checks for resources embedding. 2026-07-01 10:09:38 +05:00
go.mod refactor: move to the go.mojosa.su/util/ecsgen module path 2026-10-31 15:02:23 +05:00
go.sum init 2026-06-26 23:43:02 +05:00
main.go feat: implemented simple resource embedding generation. 2026-07-01 09:46:44 +05:00
names.go --amend 2026-07-01 13:01:59 +05:00
schema-fill.go ... 2026-07-11 13:32:14 +05:00
schema.go ... 2026-07-11 13:32:14 +05:00
template.go build: make the generator usable from a fresh clone 2026-10-31 15:19:06 +05:00