diff --git a/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/launch.tmpl.json b/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/launch.tmpl.json index 530831088..0a5437c9e 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/launch.tmpl.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/launch.tmpl.json @@ -8,8 +8,7 @@ "mode": "exec", "program": "${workspaceFolder}/{{.PathToDesktopBinary}}", "preLaunchTask": "build", - "cwd": "${workspaceFolder}", - "env": {} + "cwd": "${workspaceFolder}" }, { "name": "Wails: Debug {{.ProjectName}}", @@ -18,8 +17,16 @@ "mode": "exec", "program": "${workspaceFolder}/{{.PathToDesktopBinary}}", "preLaunchTask": "build debug", - "cwd": "${workspaceFolder}", - "env": {} + "cwd": "${workspaceFolder}" + }, + { + "name": "Wails: Dev {{.ProjectName}}", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/{{.PathToDesktopBinary}}", + "preLaunchTask": "build dev", + "cwd": "${workspaceFolder}" } ] } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/tasks.tmpl.json b/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/tasks.tmpl.json index a085ec3a9..fdf1d48dd 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/tasks.tmpl.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/ides/vscode/tasks.tmpl.json @@ -5,7 +5,25 @@ "label": "build", "type": "shell", "options": { - "cwd": "${workspaceFolder}" + "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": [ @@ -22,7 +40,25 @@ "label": "build debug", "type": "shell", "options": { - "cwd": "${workspaceFolder}" + "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": [ @@ -34,6 +70,41 @@ "-o", "{{.PathToDesktopBinary}}" ] + }, + { + "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", + "{{.PathToDesktopBinary}}" + ] } ] }