Hi!
I've just started doing some development using VSCode. I know my way around with VSCode as i use it for my job. I have almost no experience with "make" and C-tools. I think i've managed to create a few small PRs, but this took quite some time and persistance. I think it would benefit OpenWrt to make starting with development easier.
I did some tinkering and ended up with a VSCode workspace file which:
- Allows for editing multiple OpenWrt GIT repositories (packages, luci, etc.) in a single editor.
- Allows for running make package commands for the current open Makefile of a package.
- Allows for running a task by choosing from a predefined set.
- It's using the buildbot CI-container devcontainer.
I think some possible improvements:
- to aid in correct creating feature-branches
- It would allow to create some scripts to "squash multiple commits" for instance.
Is this something which is usable?
{
"folders": [
{
"path": "."
},
{
"path": "./feeds/packages"
},
{
"path": "./feeds/luci"
},
],
"extensions": {
"recommendations": [
"ms-vscode.cpptools",
"plorefice.devicetree",
"augustocdias.tasks-shell-input"
]
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "update and install all OpenWrt feeds",
"type": "shell",
"command": "./scripts/feeds update -a && ./scripts/feeds install -a",
"group": "none",
"icon": {
"id": "refresh"
},
"problemMatcher": [],
"detail": "Update and install all feeds"
},
{
"label": "override OpenWrt feeds",
"type": "shell",
"command": "cp --interactive ./feeds.conf.default ./feeds.conf && code ./feeds.conf",
"group": "none",
"icon": {
"id": "edit"
},
"problemMatcher": [],
"detail": "Customize the default feeds"
},
{
"label": "make defconfig",
"type": "shell",
"command": "make defconfig",
"group": "none",
"icon": {
"id": "star-empty"
},
"problemMatcher": [],
"detail": "Make defconfig"
},
{
"label": "make menuconfig",
"type": "shell",
"command": "make menuconfig",
"group": "none",
"icon": {
"id": "star-empty"
},
"problemMatcher": [],
"detail": "Make menuconfig"
},
{
"label": "make -j4",
"type": "shell",
"command": "make -j4",
"group": "none",
"icon": {
"id": "star-empty"
},
"problemMatcher": [],
"detail": "Make -j4"
},
{
"label": "make package of open Makefile",
"type": "shell",
"command": "make package/${input:packageID}/clean && make package/${input:packageID}/compile",
"icon": {
"id": "run"
},
"problemMatcher": []
}
],
"inputs": [
{
"id": "packageID",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "grep -F -m 1 'PKG_NAME:=' ${file} | cut -d= -f2",
"useSingleResult": true,
}
}
]
},
"settings": {
"git.alwaysSignOff": true,
"git.allowForcePush": true,
"git.confirmForcePush": true,
"git.autofetch": "all",
"git.autorefresh": true,
"git.branchProtection": ["master","main"],
"git.branchPrefix": "feature_",
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
"git.branchWhitespaceChar": "_",
"git.branchValidationRegex": "feature_.+",
},
}