gobanos / cargo-aoc

437 stars 47 forks source link

Add build only command for debugging support #69

Open TylerHorth opened 3 years ago

TylerHorth commented 3 years ago

resolves #64

Adds an aoc build command which generates and builds the subproject, without executing it. This way you can launch the aoc-autobuild executable with a debugger.

For example, in vscode using these two config files and the CodeLLDB plugin:

// .vscode/tasks.json
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "aoc",
            "type": "shell",
            "command": "cargo aoc build"
        }
    ]
}
// .vscode/launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug AOC",
            "preLaunchTask": "aoc",
            "program": "${workspaceFolder}/target/aoc/aoc-autobuild/target/debug/aoc-autobuild",
            "sourceLanguages": ["rust"],
            "args": [],
            "cwd": "${workspaceFolder}"
        }
    ]
}