From 1ce07cd67c7a5abfc05cf04141b424a3c00cecc7 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 6 Jun 2023 20:37:15 +1000 Subject: [PATCH] [v3 windows] Update Taskfile in templates --- v3/examples/build/Taskfile.yml | 23 ++++- v3/examples/dialogs/Taskfile.yml | 83 +++++++++++++++++++ .../templates/_base/default/Taskfile.tmpl.yml | 22 ++++- .../templates/lit-ts/Taskfile.tmpl.yml | 24 +++++- v3/internal/templates/lit/Taskfile.tmpl.yml | 24 +++++- .../templates/preact-ts/Taskfile.tmpl.yml | 24 +++++- .../templates/preact/Taskfile.tmpl.yml | 24 +++++- .../templates/react-swc-ts/Taskfile.tmpl.yml | 24 +++++- .../templates/react-swc/Taskfile.tmpl.yml | 24 +++++- .../templates/react-ts/Taskfile.tmpl.yml | 24 +++++- v3/internal/templates/react/Taskfile.tmpl.yml | 24 +++++- .../templates/svelte-ts/Taskfile.tmpl.yml | 24 +++++- .../templates/svelte/Taskfile.tmpl.yml | 24 +++++- .../templates/vanilla-ts/Taskfile.tmpl.yml | 24 +++++- .../templates/vanilla/Taskfile.tmpl.yml | 24 +++++- .../templates/vue-ts/Taskfile.tmpl.yml | 24 +++++- v3/internal/templates/vue/Taskfile.tmpl.yml | 24 +++++- 17 files changed, 402 insertions(+), 62 deletions(-) create mode 100644 v3/examples/dialogs/Taskfile.yml diff --git a/v3/examples/build/Taskfile.yml b/v3/examples/build/Taskfile.yml index 125f123f..145661e4 100644 --- a/v3/examples/build/Taskfile.yml +++ b/v3/examples/build/Taskfile.yml @@ -8,16 +8,33 @@ tasks: post-build: summary: Post-build hooks - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - go build -gcflags=all="-N -l" -o bin/testapp main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -28,7 +45,7 @@ tasks: build-prod: summary: Creates a production build of the application cmds: - - go build -tags production -ldflags="-w -s" -o bin/testapp + - go build -tags production -ldflags="-w -s" -o bin/testapp{{exeExt}} package:darwin: summary: Packages a production build of the application into a `.app` bundle diff --git a/v3/examples/dialogs/Taskfile.yml b/v3/examples/dialogs/Taskfile.yml new file mode 100644 index 00000000..6b72ed65 --- /dev/null +++ b/v3/examples/dialogs/Taskfile.yml @@ -0,0 +1,83 @@ +version: '3' + +tasks: + + pre-build: + summary: Pre-build hooks + + post-build: + summary: Post-build hooks + + build:darwin: + summary: Builds the application + platforms: + - darwin + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp + - task: post-build + env: + CGO_CFLAGS: "-mmacosx-version-min=10.13" + CGO_LDFLAGS: "-mmacosx-version-min=10.13" + + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + + generate-icons: + summary: Generates Windows `.ico` and Mac `.icns` files from an image + dir: build + cmds: + # Generates both .ico and .icns files + - wails generate icons -input appicon.png + + build-prod: + summary: Creates a production build of the application + cmds: + - go build -tags production -ldflags="-w -s" -o bin/testapp{{exeExt}} + + package:darwin: + summary: Packages a production build of the application into a `.app` bundle + platforms: + - darwin + deps: + - build-prod + - generate-icons + cmds: + - mkdir -p buildtest.app/Contents/{MacOS,Resources} + - cp build/icons.icns buildtest.app/Contents/Resources + - cp bin/testapp buildtest.app/Contents/MacOS + - cp build/Info.plist buildtest.app/Contents + + windows:generate:syso: + dir: build + cmds: + - wails generate syso -arch amd64 -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platforms: + - windows + deps: + - generate-icons + cmds: + - task: windows:generate:syso + - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/testapp.exe + - powershell Remove-item wails.syso + + build:production: + summary: Builds the application for production + cmds: + - task: package:darwin + - task: package:windows \ No newline at end of file diff --git a/v3/internal/templates/_base/default/Taskfile.tmpl.yml b/v3/internal/templates/_base/default/Taskfile.tmpl.yml index be23e699..f21158a3 100644 --- a/v3/internal/templates/_base/default/Taskfile.tmpl.yml +++ b/v3/internal/templates/_base/default/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build diff --git a/v3/internal/templates/lit-ts/Taskfile.tmpl.yml b/v3/internal/templates/lit-ts/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/lit-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/lit-ts/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/lit/Taskfile.tmpl.yml b/v3/internal/templates/lit/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/lit/Taskfile.tmpl.yml +++ b/v3/internal/templates/lit/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/preact-ts/Taskfile.tmpl.yml b/v3/internal/templates/preact-ts/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/preact-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/preact-ts/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/preact/Taskfile.tmpl.yml b/v3/internal/templates/preact/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/preact/Taskfile.tmpl.yml +++ b/v3/internal/templates/preact/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/react-swc-ts/Taskfile.tmpl.yml b/v3/internal/templates/react-swc-ts/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/react-swc-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/react-swc-ts/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/react-swc/Taskfile.tmpl.yml b/v3/internal/templates/react-swc/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/react-swc/Taskfile.tmpl.yml +++ b/v3/internal/templates/react-swc/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/react-ts/Taskfile.tmpl.yml b/v3/internal/templates/react-ts/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/react-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/react-ts/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/react/Taskfile.tmpl.yml b/v3/internal/templates/react/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/react/Taskfile.tmpl.yml +++ b/v3/internal/templates/react/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/svelte-ts/Taskfile.tmpl.yml b/v3/internal/templates/svelte-ts/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/svelte-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/svelte-ts/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/svelte/Taskfile.tmpl.yml b/v3/internal/templates/svelte/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/svelte/Taskfile.tmpl.yml +++ b/v3/internal/templates/svelte/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/vanilla-ts/Taskfile.tmpl.yml b/v3/internal/templates/vanilla-ts/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/vanilla-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/vanilla-ts/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/vanilla/Taskfile.tmpl.yml b/v3/internal/templates/vanilla/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/vanilla/Taskfile.tmpl.yml +++ b/v3/internal/templates/vanilla/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/vue-ts/Taskfile.tmpl.yml b/v3/internal/templates/vue-ts/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/vue-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/vue-ts/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso diff --git a/v3/internal/templates/vue/Taskfile.tmpl.yml b/v3/internal/templates/vue/Taskfile.tmpl.yml index e1383bdc..f21158a3 100644 --- a/v3/internal/templates/vue/Taskfile.tmpl.yml +++ b/v3/internal/templates/vue/Taskfile.tmpl.yml @@ -33,17 +33,33 @@ tasks: cmds: - npm run build - build: + build:darwin: summary: Builds the application + platforms: + - darwin cmds: - task: pre-build - - task: build-frontend - - go build -gcflags=all="-N -l" -o build/bin/{{ "{{.APP_NAME}}" }} main.go + - go build -gcflags=all="-N -l" -o bin/testapp - task: post-build env: CGO_CFLAGS: "-mmacosx-version-min=10.13" CGO_LDFLAGS: "-mmacosx-version-min=10.13" + build:windows: + summary: Builds the application for Windows + platforms: + - windows + cmds: + - task: pre-build + - go build -gcflags=all="-N -l" -o bin/testapp.exe + - task: post-build + + build: + summary: Builds the application + cmds: + - task: build:darwin + - task: build:windows + generate-icons: summary: Generates Windows `.ico` and Mac `.icns` files from an image dir: build @@ -100,6 +116,6 @@ tasks: cmds: - task: generate:syso vars: - ARCH: amd64 + ARCH: amd64 - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe - powershell Remove-item wails.syso