Build with Magefile #104341

Merged
Sybren A. Stüvel merged 26 commits from magefile into main 2024-10-04 21:59:46 +02:00
2 changed files with 17 additions and 3 deletions
Showing only changes of commit 731a484d9e - Show all commits

View File

@ -49,9 +49,8 @@ export CGO_ENABLED=0
all: application all: application
# Install generators and build the software. # Install generators and build the software.
with-deps: with-deps: buildtool
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.9.0 "${BUILDTOOL_PATH}" installGenerators
go install github.com/golang/mock/mockgen@v1.6.0
$(MAKE) application $(MAKE) application
vet: buildtool vet: buildtool

View File

@ -18,12 +18,27 @@ const (
) )
var ( var (
generators = []string{
"github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.9.0",
"github.com/golang/mock/mockgen@v1.6.0",
}
// The directory that will contain the built webapp files, and some other // The directory that will contain the built webapp files, and some other
// files that will be served as static files by the Flamenco Manager web // files that will be served as static files by the Flamenco Manager web
// server. // server.
webStatic = filepath.Join("web", "static") webStatic = filepath.Join("web", "static")
) )
// Install code generators.
func InstallGenerators() error {
for _, pkg := range generators {
if err := sh.RunV(mg.GoCmd(), "install", pkg); err != nil {
return err
}
}
return nil
}
// Build Flamenco Manager and Flamenco Worker, including the webapp and the add-on // Build Flamenco Manager and Flamenco Worker, including the webapp and the add-on
func Build() { func Build() {
mg.Deps(FlamencoManager, FlamencoWorker) mg.Deps(FlamencoManager, FlamencoWorker)