Sybren A. Stüvel 65f391183e Add install-generators make target and improve documentation
Add Make target `install-generators` as alias for `mage installGenerators`
and update the documentation for it.
2025-06-30 11:01:15 +02:00

1.7 KiB

title weight
Generating Code 20

Some code (Go, Python, JavaScript) is generated from the OpenAPI specs in pkg/api/flamenco-openapi.yaml. There are also Go files generated to create mock implementations of interfaces for unit testing purposes.

Installing the Code Generators

There are three code generators used by Flamenco:

The first two generators can be installed with either of these commands:

# Simplest way to install the Go generators:
$ go run mage.go installGenerators

# Faster to re-run than the above, but does require Make:
$ make install-generators

openapi-codegen is bundled with the Flamenco sources, but does need a Java runtime environment to be installed. On Ubuntu Linux, sudo apt install default-jre-headless should be enough.

Committing Generated Code

Generated code is committed to Git, so that after a checkout you shouldn't need to re-run the generator to build Flamenco.

The following files & directories are generated. Generated directories are completely erased before regeneration, so do not add any files there manually.

  • addon/flamenco/manager/: Python API for the Blender add-on.
  • pkg/api/*.gen.go: Go API shared by Manager and Worker.
  • internal/**/mocks/*.gen.go: Generated mocks for Go unit tests.
  • web/app/src/manager-api/: JavaScript API for the web front-end.