5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 17:22:01 +08:00
wails/v3/Taskfile.yaml
Lea Anthony 5dbda4aead
Feature: AssetServer Runtime (#2335)
* Tidy up runtime JS

* Initial implementation of runtime over http

* Update runtime deps. Fix test task.

* Support Clipboard.
Message Processor refactor.

* Add `Window.Screen()`
Clipboard `GetText` -> `Text`

* Support most dialogs
Better JS->Go object mapping
Implement Go->JS callback mechanism
Rename `window.runtime` -> `window.wails` to better reflect the Go API

* Support SaveFile dialog

* Remove go.work

* Tidy up

* Event->CustomEvent to prevent potential clash with native JS Event object
Support Eventing

* Support application calls

* Support logging

* Support named windows
Remove debug info

* Update v3 changes
2023-02-06 20:50:11 +11:00

203 lines
5.4 KiB
YAML

# https://taskfile.dev
version: '3'
tasks:
build-runtime-debug:
dir: internal/runtime
internal: true
cmds:
- npx esbuild desktop/main.js --bundle --sourcemap=inline --outfile=runtime_debug_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}}
build-runtime-debug-windows:
cmds:
- task: build-runtime-debug
vars:
WINDOWS: true
DARWIN: false
LINUX: false
PLATFORM: windows
build-runtime-debug-linux:
cmds:
- task: build-runtime-debug
vars:
WINDOWS: false
DARWIN: false
LINUX: true
PLATFORM: linux
build-runtime-debug-darwin:
cmds:
- task: build-runtime-debug
vars:
WINDOWS: false
DARWIN: true
LINUX: false
PLATFORM: darwin
build-runtime-production:
dir: internal/runtime
internal: true
cmds:
- npx esbuild desktop/main.js --bundle --minify --outfile=runtime_production_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}}
build-runtime-production-windows:
cmds:
- task: build-runtime-production
vars:
WINDOWS: true
DARWIN: false
LINUX: false
PLATFORM: windows
build-runtime-production-linux:
cmds:
- task: build-runtime-production
vars:
WINDOWS: false
DARWIN: false
LINUX: true
PLATFORM: linux
build-runtime-production-darwin:
cmds:
- task: build-runtime-production
vars:
WINDOWS: false
DARWIN: true
LINUX: false
PLATFORM: darwin
install-runtime-dev-deps:
dir: internal/runtime/dev
internal: true
sources:
- package.json
cmds:
- npm install
install-runtime-deps:
dir: internal/runtime
internal: true
sources:
- package.json
cmds:
- npm install
test-runtime:
dir: internal/runtime
cmds:
- npx vitest run
update-runtime:
dir: internal/runtime
cmds:
- npx npm-check-updates -u
build-runtime-all:
dir: internal/runtime
deps:
- build-runtime-production-darwin
- build-runtime-production-windows
- build-runtime-production-linux
- build-runtime-debug-darwin
- build-runtime-debug-windows
- build-runtime-debug-linux
cmds:
- cmd: echo "build complete"
build-runtime:
dir: internal/runtime
deps:
- install-runtime-deps
cmds:
- task: build-runtime-all
recreate-template-dir:
dir: internal/templates
internal: true
silent: true
cmds:
- rm -rf {{.TEMPLATE_DIR}}
- mkdir -p {{.TEMPLATE_DIR}}
generate-template:
dir: internal/templates/{{.TEMPLATE}}
deps:
- task: recreate-template-dir
vars:
TEMPLATE_DIR: "{{.TEMPLATE}}"
silent: true
cmds:
- cmd: pnpm create vite frontend --template {{.TEMPLATE}}
- cmd: cp -rf ../_base/{{.TEMPLATE}}/* .
ignore_error: true
- cmd: cp -rf ../_base/default/* .
ignore_error: true
- cmd: rm frontend/public/vite.svg
- cmd: go run ../../../tasks/sed/sed.go replace -dir frontend -old Vite -new Wails -ext .ts,.js,.html -ignore vite.config.js,vite.config.ts,vite-env.d.ts
- cmd: go run ../../../tasks/sed/sed.go replace -dir frontend -old vite -new wails -ext .ts,.js,.html -ignore vite.config.js,vite.config.ts,vite-env.d.ts
- cmd: go run ../../../tasks/sed/sed.go replace -dir frontend -old wails.svg -new wails.png -ext .ts,.js,.html -ignore vite.config.js,vite.config.ts,vite-env.d.ts
- cmd: go run ../../../tasks/sed/sed.go replace -dir frontend -old wailsjs.dev -new wails.io -ext .ts,.js,.html -ignore vite.config.js,vite.config.ts,vite-env.d.ts
- cmd: go run ../../../tasks/sed/sed.go replace -dir frontend -old "framework powered by Wails" -new "framework powered by Vite" -ext .ts,.js,.html,.svelte -ignore vite.config.js,vite.config.ts,vite-env.d.ts
reinstall-cli:
dir: cmd/wails
internal: true
cmds:
- go install
- echo "Reinstalled wails CLI"
generate-templates:
dir: internal/templates/
deps:
- task: generate-template
vars:
TEMPLATE: svelte
- task: generate-template
vars:
TEMPLATE: svelte-ts
- task: generate-template
vars:
TEMPLATE: vue
- task: generate-template
vars:
TEMPLATE: vue-ts
- task: generate-template
vars:
TEMPLATE: react
- task: generate-template
vars:
TEMPLATE: react-ts
- task: generate-template
vars:
TEMPLATE: preact
- task: generate-template
vars:
TEMPLATE: preact-ts
- task: generate-template
vars:
TEMPLATE: lit
- task: generate-template
vars:
TEMPLATE: lit-ts
- task: generate-template
vars:
TEMPLATE: vanilla
- task: generate-template
vars:
TEMPLATE: vanilla-ts
- task: generate-template
vars:
TEMPLATE: react-swc
- task: generate-template
vars:
TEMPLATE: react-swc-ts
cmds:
- task: reinstall-cli
- echo "Generated templates"