diff --git a/v3/examples/build/Taskfile.yml b/v3/examples/build/Taskfile.yml index 67e1db618..125f123fd 100644 --- a/v3/examples/build/Taskfile.yml +++ b/v3/examples/build/Taskfile.yml @@ -20,6 +20,7 @@ tasks: 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 @@ -29,7 +30,7 @@ tasks: cmds: - go build -tags production -ldflags="-w -s" -o bin/testapp - package-darwin: + package:darwin: summary: Packages a production build of the application into a `.app` bundle deps: - build-prod @@ -38,4 +39,18 @@ tasks: - 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 \ No newline at end of file + - cp build/Info.plist buildtest.app/Contents + + windows:generate:syso: + dir: build + cmds: + - wails generate syso -arch amd64 -icon icons.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 + 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 diff --git a/v3/internal/commands/defaults/icons.ico b/v3/examples/build/build/icon.ico similarity index 92% rename from v3/internal/commands/defaults/icons.ico rename to v3/examples/build/build/icon.ico index f33479841..bfa0690b7 100644 Binary files a/v3/internal/commands/defaults/icons.ico and b/v3/examples/build/build/icon.ico differ diff --git a/v3/examples/build/main.go b/v3/examples/build/main.go index 5bb3f0df1..131b8a4f1 100755 --- a/v3/examples/build/main.go +++ b/v3/examples/build/main.go @@ -36,7 +36,9 @@ func main() { // Create a custom menu menu := app.NewMenu() - menu.AddRole(application.AppMenu) + if runtime.GOOS == "darwin" { + menu.AddRole(application.AppMenu) + } windowCounter := 1 diff --git a/v3/internal/templates/_base/default/Taskfile.tmpl.yml b/v3/internal/templates/_base/default/Taskfile.tmpl.yml index 5e8c5f4aa..be23e6990 100644 --- a/v3/internal/templates/_base/default/Taskfile.tmpl.yml +++ b/v3/internal/templates/_base/default/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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-ts/Taskfile.tmpl.yml b/v3/internal/templates/lit-ts/Taskfile.tmpl.yml index 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/lit-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/lit-ts/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/lit/Taskfile.tmpl.yml +++ b/v3/internal/templates/lit/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/preact-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/preact-ts/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/preact/Taskfile.tmpl.yml +++ b/v3/internal/templates/preact/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/react-swc-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/react-swc-ts/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/react-swc/Taskfile.tmpl.yml +++ b/v3/internal/templates/react-swc/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/react-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/react-ts/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/react/Taskfile.tmpl.yml +++ b/v3/internal/templates/react/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/svelte-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/svelte-ts/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/svelte/Taskfile.tmpl.yml +++ b/v3/internal/templates/svelte/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/vanilla-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/vanilla-ts/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/vanilla/Taskfile.tmpl.yml +++ b/v3/internal/templates/vanilla/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/vue-ts/Taskfile.tmpl.yml +++ b/v3/internal/templates/vue-ts/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + 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 5e8c5f4aa..e1383bdcd 100644 --- a/v3/internal/templates/vue/Taskfile.tmpl.yml +++ b/v3/internal/templates/vue/Taskfile.tmpl.yml @@ -82,4 +82,24 @@ tasks: ARCH: arm64 - generate-icons cmds: - - task: create-app-bundle \ No newline at end of file + - task: create-app-bundle + + generate:syso: + dir: build + platform: windows + cmds: + - wails generate syso -arch {{ "{{.ARCH}}" }} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso + vars: + ARCH: $GOARCH + + package:windows: + summary: Packages a production build of the application into a `.exe` bundle + platform: windows + deps: + - generate-icons + cmds: + - task: generate:syso + vars: + ARCH: amd64 + - go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{ "{{.APP_NAME}}" }}.exe + - powershell Remove-item wails.syso