From c38cee0a4acfbb6e6aea6a4e11c689a7418527ec Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 29 Apr 2024 17:40:46 +1000 Subject: [PATCH] More optimised production build in project taskfile --- v3/internal/templates/_common/Taskfile.tmpl.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v3/internal/templates/_common/Taskfile.tmpl.yml b/v3/internal/templates/_common/Taskfile.tmpl.yml index 5082a2524..39895bf58 100644 --- a/v3/internal/templates/_common/Taskfile.tmpl.yml +++ b/v3/internal/templates/_common/Taskfile.tmpl.yml @@ -34,7 +34,7 @@ tasks: cmds: - go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{.ProjectName}}.exe vars: - BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s -H windowsgui\"{{else}}-gcflags=all=\"-N -l\"{{end}}'" }} + BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s -H windowsgui\"{{else}}-gcflags=all=\"-l\"{{end}}'" }} env: GOOS: windows CGO_ENABLED: 0 @@ -82,7 +82,7 @@ tasks: cmds: - go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{ "{{.APP_NAME}}" }} vars: - BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-N -l\"{{end}}'" }} + BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }} env: GOOS: darwin CGO_ENABLED: 1 @@ -136,7 +136,7 @@ tasks: cmds: - go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{.ProjectName}} vars: - BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-N -l\"{{end}}'" }} + BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }} env: GOOS: linux CGO_ENABLED: 1