mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-11 14:39:30 +08:00

* Refactor taskfile * Fix escaping * Fix event error * Fix dev mode * Fixes for Windows * Add docs. Improve docs build system * Update v3/internal/commands/build_assets/Taskfile.darwin.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update v3/internal/commands/build_assets/Taskfile.linux.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Improve docs --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
version: '3'
|
|
|
|
includes:
|
|
common: Taskfile.common.yml
|
|
|
|
tasks:
|
|
build:
|
|
summary: Creates a production build of the application
|
|
deps:
|
|
- task: common:go:mod:tidy
|
|
- task: common:build:frontend
|
|
- task: common:generate:icons
|
|
cmds:
|
|
- go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}
|
|
vars:
|
|
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -ldflags="-w -s"{{else}}-gcflags=all="-l"{{end}}'
|
|
env:
|
|
GOOS: darwin
|
|
CGO_ENABLED: 1
|
|
GOARCH: '{{.ARCH | default ARCH}}'
|
|
CGO_CFLAGS: "-mmacosx-version-min=10.15"
|
|
CGO_LDFLAGS: "-mmacosx-version-min=10.15"
|
|
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
|
PRODUCTION: '{{.PRODUCTION | default "false"}}'
|
|
|
|
package:
|
|
summary: Packages a production build of the application into a `.app` bundle
|
|
deps:
|
|
- task: build
|
|
vars:
|
|
PRODUCTION: "true"
|
|
cmds:
|
|
- task: create:app:bundle
|
|
|
|
create:app:bundle:
|
|
summary: Creates an `.app` bundle
|
|
cmds:
|
|
- mkdir -p {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/{MacOS,Resources}
|
|
- cp build/icons.icns {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Resources
|
|
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/MacOS
|
|
- cp build/Info.plist {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents
|
|
|
|
run:
|
|
cmds:
|
|
- '{{.BIN_DIR}}/{{.APP_NAME}}'
|