Closed Torguen closed 2 years ago
You are right, it does not build the game, it only executes it. I actually prefer it that way because then I can just launch the game without having to recompile everytime. To get the behavior you are looking for you can add a preLaunchTask
:
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "godot-mono",
"request": "launch",
"mode": "executable",
"preLaunchTask": "build",
"executable": "godot",
"executableArguments": [
"--path",
"${workspaceRoot}"
]
}
]
},
.vscoded/tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "msbuild",
"args": [
// Ask msbuild to generate full paths for file names.
"/property:GenerateFullPaths=true",
"/t:build",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
// Reveal the output only if unrecognized errors occur.
"reveal": "silent"
},
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
}
]
}
This build task was generated by vscode:
Open the Command Palette (Ctrl + Shift + P) and select Tasks: Configure Task
Select Create tasks.json file from template
Select MSBuild
or .NET Core
(If not sure take a look at which Build tool
is selected in Godot Editor settings, I think the default is dotnet CLI
so .NET Core
)
Alternatively, you can use the Godot CLI to compile the project with a task like this:
.vscoded/tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "godot",
"type": "shell",
"args": [
"--build-solutions", // Opens the editor to build the game
"--path", "${workspaceRoot}", // Specifies the game project directory
"--no-window", // To hide the editor that builds
"-q" // To close the editor after building
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
Where did that come from? I never did that. Thanks for the help guys.
It's automatically done by Github when creating an issue, it's specified in the template:
win10 64
Issue description:
I am using "launch" but a new version is not created with my new code. It seems that launching does not recompile the game and execute this new version, am I wrong?
Screenshots of issue: