Documentation: Update and simplify VSCode Task recommendation

With these you'll only need 3 tasks to cover lagom and all of normal
build and launch with just 3 Tasks and two option menus.
This commit is contained in:
Hendiadyoin1 2021-11-03 13:57:26 +01:00 committed by Linus Groh
parent 7613586097
commit 1bbdce7e81
Notes: sideshowbarker 2024-07-18 01:28:08 +09:00

View file

@ -129,44 +129,30 @@ These belong in the `.vscode/settings.json` of Serenity.
### Custom Tasks ### Custom Tasks
You can create custom tasks (`.vscode/tasks.json`) to quickly compile Serenity. The following are two example tasks, a "just build" task and a "build and run" task for i686 that also give you error highlighting: You can create custom tasks (`.vscode/tasks.json`) to quickly compile Serenity.
The following three example tasks should suffice in most situations, and allow you to specify the build system to use, as well as give you error highlighting.
Note: The Assertion und KUBSan Problem matchers will only run after you have closed qemu.
<details>
<summary>tasks.json</summary>
```json ```json
{ {
"tasks": [ "tasks": [
{ {
"label": "build", "label": "build lagom",
"type": "shell", "type": "shell",
"problemMatcher": [ "problemMatcher":[{
{ "base": "$gcc",
"base": "$gcc", "fileLocation": ["relative","${workspaceFolder}/Build/lagom"]
"fileLocation": [ }],
"relative",
"${workspaceFolder}/Build/i686"
]
},
{
"source": "gcc",
"fileLocation": [
"relative",
"${workspaceFolder}/Build/i686"
],
"pattern": [
{
"regexp": "^([^\\s]*\\.S):(\\d*): (.*)$",
"file": 1,
"location": 2,
"message": 3
}
]
}
],
"command": [ "command": [
"bash" "bash"
], ],
"args": [ "args": [
"-c", "-c",
"\"Meta/serenity.sh image\"" "\"Meta/serenity.sh build lagom\""
], ],
"presentation": { "presentation": {
"echo": true, "echo": true,
@ -179,97 +165,153 @@ You can create custom tasks (`.vscode/tasks.json`) to quickly compile Serenity.
} }
}, },
{ {
"label": "launch", "label": "build",
"type": "shell", "type": "shell",
"linux": { "command": "bash",
"command": "bash",
"args": [ "args": [
"-c", "-c",
"\"Meta/serenity.sh run\"" "Meta/serenity.sh build ${input:arch} ${input:compiler}"
],
"options": {
"env": {
"SERENITY_RAM_SIZE": "4G",
}
},
"problemMatcher": [
{
"base": "$gcc",
"fileLocation": [
"relative",
// FIXME: Clang uses ${input:arch}clang
"${workspaceFolder}/Build/${input:arch}"
]
},
{
"source": "gcc",
"fileLocation": [
"relative",
// FIXME: Clang uses ${input:arch}clang
"${workspaceFolder}/Build/${input:arch}"
],
"pattern": [
{
"regexp": "^([^\\s]*\\.S):(\\d*): (.*)$",
"file": 1,
"location": 2,
"message": 3
}
]
}
]
},
{
"label": "launch",
"type": "shell",
"command": "bash",
"args": [
"-c",
"Meta/serenity.sh run ${input:arch} ${input:compiler}"
], ],
"options": { "options": {
"env": { "env": {
// Put your custom run configuration here, e.g. SERENITY_RAM_SIZE // Put your custom run configuration here, e.g. SERENITY_RAM_SIZE
} }
}
},
"problemMatcher": [
{
"source": "Assertion Failed",
"fileLocation": [
"relative",
"${workspaceFolder}/Build/i686"
],
"pattern": [
{
"regexp": "ASSERTION FAILED: (.*)$",
"message": 1
},
{
"regexp": "^((?:.*)\\.(h|cpp|c|S)):(\\d*)$",
"file":1,
"location":3
}
]
}, },
{ "problemMatcher": [
"source": "KUBSan", {
"owner": "cpp", "base": "$gcc",
"fileLocation": [ "fileLocation": [
"relative", "relative",
"${workspaceFolder}" // FIXME: Clang uses ${input:arch}clang
], "${workspaceFolder}/Build/${input:arch}"
"pattern": [ ]
{ },
"regexp": "KUBSAN: (.*)", {
"message": 0 "source": "gcc",
}, "fileLocation": [
{ "relative",
"regexp": "KUBSAN: at ../(.*), line (\\d*), column: (\\d*)", // FIXME: Clang uses ${input:arch}clang
"file": 1, "${workspaceFolder}/Build/${input:arch}"
"line": 2, ],
"column": 3 "pattern": [
} {
] "regexp": "^([^\\s]*\\.S):(\\d*): (.*)$",
}, "file": 1,
{ "location": 2,
"base": "$gcc", "message": 3
"fileLocation": [ }
"relative", ]
"${workspaceFolder}/Build/i686" },
] {
}, "source": "KUBSan",
{ "owner": "cpp",
"source": "gcc", "fileLocation": [
"fileLocation": [ "relative",
"relative", "${workspaceFolder}"
"${workspaceFolder}/Build/i686" ],
], "pattern": [
"pattern": [ {
{ "regexp": "KUBSAN: (.*)",
"regexp": "^([^\\s]*\\.S):(\\d*): (.*)$", "message": 0
"file": 1, },
"location": 2, {
"message": 3 "regexp": "KUBSAN: at ../(.*), line (\\d*), column: (\\d*)",
} "file": 1,
] "line": 2,
} "column": 3
], }
"presentation": { ]
"echo": true, },
"reveal": "always", {
"group": "run", "source": "Assertion Failed",
"focus": false, "owner": "cpp",
"panel": "shared", "pattern": [
"showReuseMessage": true, {
"clear": true "regexp": "ASSERTION FAILED: (.*)$",
} "message": 1
},
{
"regexp": "^((?:.*)\\.(h|cpp|c|S)):(\\d*)$",
"file":1,
"location":3
}
],
"fileLocation": [
"relative",
// FIXME: Clang uses ${input:arch}clang
"${workspaceFolder}/Build/${input:arch}"
]
}
]
}
],
"inputs": [
{
"id": "compiler",
"description": "Compiler to use",
"type": "pickString",
"default": "GNU",
"options": [
"GNU",
"Clang"
]
}, },
{
"id": "arch",
"description": "Architecture to compile for",
"type": "pickString",
"default": "i686",
"options": [
"i686",
"x86_64",
"aarch64"
]
}
] ]
} }
``` ```
This can easily be adopted into x86_64 by appending the architecture to the serenity.sh commands. </details>
### License snippet ### License snippet