dev config

This commit is contained in:
josc146 2023-06-05 22:57:01 +08:00
parent 4cd445bf77
commit 17faa9c5b8
3 changed files with 66 additions and 5 deletions

19
.vscode/launch.json vendored
View File

@ -10,9 +10,24 @@
"name": "Python",
"type": "python",
"request": "launch",
"program": "./backend-python/main.py",
"program": "${workspaceFolder}/backend-python/main.py",
"console": "integratedTerminal",
"justMyCode": false,
"justMyCode": false
},
{
"name": "Golang",
"type": "go",
"request": "launch",
"mode": "exec",
"program": "${workspaceFolder}/build/bin/testwails.exe",
"console": "integratedTerminal",
"preLaunchTask": "build dev"
},
{
"name": "Frontend",
"type": "node-terminal",
"request": "launch",
"command": "wails dev -browser"
}
]
}

40
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,40 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build dev",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}",
"env": {
"CGO_ENABLED": "1"
}
},
"osx": {
"options": {
"env": {
"CGO_CFLAGS": "-mmacosx-version-min=10.13",
"CGO_LDFLAGS": "-framework UniformTypeIdentifiers -mmacosx-version-min=10.13"
}
}
},
"windows": {
"options": {
"env": {
"CGO_ENABLED": "0"
}
}
},
"command": "go",
"args": [
"build",
"-tags",
"dev",
"-gcflags",
"all=-N -l",
"-o",
"build/bin/testwails.exe"
]
}
]
}

View File

@ -1,16 +1,22 @@
ifeq ($(OS), Windows_NT)
build: build-windows
else
else ifeq ($(shell uname -s), Darwin)
build: build-macos
else
build: build-linux
endif
build-windows:
@echo ---- build for windows
wails build -upx -ldflags "-s -w"
wails build -upx -ldflags "-s -w" -platform windows/amd64
build-macos:
@echo ---- build for macos
wails build -ldflags "-s -w"
wails build -ldflags "-s -w" -platform darwin/universal
build-linux:
@echo ---- build for linux
wails build -upx -ldflags "-s -w" -platform linux/amd64
dev:
wails dev