Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] Pass build flags to binding generator #4023

Merged
1 change: 1 addition & 0 deletions docs/src/content/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix nil menu issue when calling RegisterContextMenu by [@leaanthony](https://github.com/leaanthony)
- Fixed dependency cycles in binding generator output by [@fbbdev](https://github.com/fbbdev) in [#4001](https://github.com/wailsapp/wails/pull/4001)
- Fixed use-before-define errors in binding generator output by [@fbbdev](https://github.com/fbbdev) in [#4001](https://github.com/wailsapp/wails/pull/4001)
- Pass build flags to binding generator by [@fbbdev](https://github.com/fbbdev) in [#4023](https://github.com/wailsapp/wails/pull/4023)

### Changed

Expand Down
11 changes: 5 additions & 6 deletions v3/internal/commands/build_assets/Taskfile.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ tasks:
deps:
- task: install:frontend:deps
- task: generate:bindings
vars:
BUILD_FLAGS:
ref: .BUILD_FLAGS
cmds:
- npm run {{ "{{.BUILD_COMMAND}}" }} -q
env:
Expand All @@ -43,14 +46,10 @@ tasks:
summary: Generates bindings for the frontend
deps:
- task: go:mod:tidy
sources:
- "**/*.go"
- go.mod
- go.sum
generates:
- "frontend/bindings/**/*"
cmds:
- wails3 generate bindings -f {{ "'{{.BUILD_FLAGS}}'" }} -clean=true {{if .Typescript}} -ts{{end}}
- wails3 generate bindings -f {{ "'{{.BUILD_FLAGS}}'" }} -clean=true {{- if .Typescript}} -ts{{end}}

generate:icons:
summary: Generates Windows `.ico` and Mac `.icns` files from an image
Expand All @@ -75,4 +74,4 @@ tasks:
summary: Updates the build assets
dir: build
cmds:
- wails3 update build-assets -name {{ "\"{{.APP_NAME}}\"" }} -binaryname {{ "\"{{.APP_NAME}}\"" }} -config config.yml -dir .
- wails3 update build-assets -name {{ "\"{{.APP_NAME}}\"" }} -binaryname {{ "\"{{.APP_NAME}}\"" }} -config config.yml -dir .
3 changes: 3 additions & 0 deletions v3/internal/commands/build_assets/darwin/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ tasks:
deps:
- task: common:go:mod:tidy
- task: common:build:frontend
vars:
BUILD_FLAGS:
ref: .BUILD_FLAGS
- task: common:generate:icons
cmds:
- go build {{.BUILD_FLAGS}} -o {{.OUTPUT}}
Expand Down
9 changes: 6 additions & 3 deletions v3/internal/commands/build_assets/linux/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ tasks:
deps:
- task: common:go:mod:tidy
- task: common:build:frontend
vars:
BUILD_FLAGS:
ref: .BUILD_FLAGS
- task: common:generate:icons
cmds:
- go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}
Expand Down Expand Up @@ -83,17 +86,17 @@ tasks:

generate:deb:
summary: Creates a deb package
cmds:
cmds:
- wails3 tool package -name {{.APP_NAME}} -format deb -config ./build/linux/nfpm/nfpm.yaml -out {{.ROOT_DIR}}/bin

generate:rpm:
summary: Creates a rpm package
cmds:
cmds:
- wails3 tool package -name {{.APP_NAME}} -format rpm -config ./build/linux/nfpm/nfpm.yaml -out {{.ROOT_DIR}}/bin

generate:aur:
summary: Creates a arch linux packager package
cmds:
cmds:
- wails3 tool package -name {{.APP_NAME}} -format archlinux -config ./build/linux/nfpm/nfpm.yaml -out {{.ROOT_DIR}}/bin

generate:dotdesktop:
Expand Down
7 changes: 5 additions & 2 deletions v3/internal/commands/build_assets/windows/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ tasks:
- task: common:go:mod:tidy
- task: common:build:frontend
vars:
PRODUCTION: '{{.PRODUCTION}}'
BUILD_FLAGS:
ref: .BUILD_FLAGS
PRODUCTION:
ref: .PRODUCTION
- task: common:generate:icons
cmds:
- task: generate:syso
Expand Down Expand Up @@ -57,4 +60,4 @@ tasks:

run:
cmds:
- '{{.BIN_DIR}}\\{{.APP_NAME}}.exe'
- '{{.BIN_DIR}}\\{{.APP_NAME}}.exe'
Loading