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
# Install generators and build the software.
with-deps:
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.9.0
go install github.com/golang/mock/mockgen@v1.6.0
with-deps: buildtool
"${BUILDTOOL_PATH}" installGenerators
$(MAKE) application
vet: buildtool

View File

@ -18,12 +18,27 @@ const (
)
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
// files that will be served as static files by the Flamenco Manager web
// server.
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
func Build() {
mg.Deps(FlamencoManager, FlamencoWorker)