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

VSCode setup #145

Closed
BastiaanOlij opened this issue Dec 31, 2021 · 0 comments
Closed

VSCode setup #145

BastiaanOlij opened this issue Dec 31, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@BastiaanOlij
Copy link
Member

BastiaanOlij commented Dec 31, 2021

For anyone who finds this useful, this is my vscode setup for building this plugin with vscode. Create a folder called .vscode and create the files and copy/paste the contents from this entry.

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 godot-cpp debug",
            "type": "shell",
            "command": "scons",
            "group": "build",
            "options": {
                "cwd": "${workspaceFolder}/thirdparty/godot-cpp"
            },
            "args": [
                "target=debug",
                "-j8"
            ],
            "problemMatcher": "$msCompile"
        },
        {
            "label": "build desktop plugin debug",
            "type": "shell",
            "command": "scons",
            "group": "build",
            "args": [
                "target=debug",
            ],
            "problemMatcher": "$msCompile"
        },
        {
            "label": "build android plugin",
            // this assumes we've already generate our godot-cpp code (which "build godot-cpp debug" does for us)
            "type": "shell",
            "windows": {
                "command": "./gradlew.bat"
            },
            "linux": {
                "command": "./gradlew"
            },
            "group": "build",
            "args": [
                "generateSharedLibs"
            ]
            "problemMatcher": "$msCompile"
        }
    ]
}

launch.json
For the launch.json file, this is setup for Windows so you will need to alter the paths if you're on Linux. You'll always need to adjust the path to your Godot executable. This allows you to debug the plugin (on desktop).

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Editor Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "D:/Development/godot3-git/bin/godot.windows.opt.tools.64.exe",
            "args": [
                "-e",
                "--path",
                "demo"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "integratedTerminal",
            "preLaunchTask": "build desktop plugin debug"
        },
        {
            "name": "Runtime Launch (Default)",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "D:/Development/godot3-git/bin/godot.windows.opt.tools.64.exe",
            "args": [
                "--path",
                "demo"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "integratedTerminal",
            "preLaunchTask": "build desktop plugin debug"
        },
        {
            "name": "Runtime Launch (SteamVR)",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "D:/Development/godot3-git/bin/godot.windows.opt.tools.64.exe",
            "args": [
                "--path",
                "demo"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [
                { "name": "XR_RUNTIME_JSON", "value": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\SteamVR\\steamxr_win64.json" }
            ],
            "console": "integratedTerminal",
            "preLaunchTask": "build desktop plugin debug"
        },
        {
            "name": "Runtime Launch (Oculus)",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "D:/Development/godot3-git/bin/godot.windows.opt.tools.64.exe",
            "args": [
                "--path",
                "demo"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [
                { "name": "XR_RUNTIME_JSON", "value": "C:\\Program Files\\Oculus\\Support\\oculus-runtime\\oculus_openxr_64.json" }
            ],
            "console": "integratedTerminal",
            "preLaunchTask": "build desktop plugin debug"
        }
    ]
}
@BastiaanOlij BastiaanOlij added the documentation Improvements or additions to documentation label Dec 31, 2021
@BastiaanOlij BastiaanOlij pinned this issue Dec 31, 2021
@m4gr3d m4gr3d closed this as completed Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants