Skip to content

Make more idiomatic gencode checkers + enable assets installation

Didier Roche requested to merge didrocks/weeport:gencode_idiomatic into master
  • Rename package to gencode.go
  • Abstract in a Generator interface what the generator should implement. Rename other elements to become methods from a check object and pass parameters to it, still keeping under the caller control the destination path. Note that it might be a directory in the future (like for i18n po refreshes).
  • Make optional the check flag installation. When we are going to ship assets, those check won't be compatible in the go generate call and better thus to not offer them in this mode.
  • Rename variable to check from CHECK_GOGENERATE to GOGENERATE_CHECK (which seems better to find it in your environment, as the main object we act upon is go generate).

Also, enable assets installation:

  • For package and distro builds, we may want to install assets, translations and other kind of files external to weeport.
  • For this, implements and install.go helper which is able to copy assets on the system. Ensure we don't embedded the assets in the binary in this case and run a dedicated generator for this.
  • Write instructions for those.
  • Refresh assets.go for build tag to ensure they won't be included by go build --tags=external
Edited by Didier Roche

Merge request reports