2018-11-25 17:00:14 -08:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
|
2018-12-11 22:31:15 -08:00
|
|
|
# Separate core packages from those that depend on the whole library being built.
|
2018-12-30 18:40:45 -08:00
|
|
|
core=$(go list ./... | grep -Ev 'avo/(examples|tests)')
|
|
|
|
|
post=$(go list ./... | grep -E 'avo/(examples|tests)')
|
2018-12-11 22:31:15 -08:00
|
|
|
|
2018-11-25 17:00:14 -08:00
|
|
|
# Install avogen (for bootstrapping).
|
|
|
|
|
go install ./internal/cmd/avogen
|
|
|
|
|
|
|
|
|
|
# Attempt to delete generated files, to prove we can recreate them.
|
2019-01-13 10:12:52 -08:00
|
|
|
grep -RE '^// Code generated.*DO NOT EDIT\.$' . | grep -v download | cut -d: -f1 | grep -v '.md$' | xargs rm -v
|
2018-11-25 17:00:14 -08:00
|
|
|
|
|
|
|
|
# Generate once.
|
2018-12-11 22:31:15 -08:00
|
|
|
go generate -v -x ${core}
|
2018-11-25 17:00:14 -08:00
|
|
|
|
|
|
|
|
# If the instruction database has changed, may need to repeat.
|
|
|
|
|
go install ./internal/cmd/avogen
|
2018-12-11 22:31:15 -08:00
|
|
|
go generate -v -x ${core}
|
|
|
|
|
|
|
|
|
|
# Generate dependent packages.
|
|
|
|
|
go generate -v -x ${post}
|
2018-12-31 20:25:29 -08:00
|
|
|
|
|
|
|
|
# Regenerate documentation.
|
|
|
|
|
./script/doc
|