Closed nnkn closed 1 year ago
Well, I guess I need to fix the extension to notice that you added a "-r" option. I'll try to fix that in the next release.
But meanwhile, the way I expected this to work is that you would put something like this in your .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "monkeyc",
"request": "launch",
"name": "Run Unoptimized",
"stopAtLaunch": false,
"device": "${command:GetTargetDevice}",
},
{
"type": "omonkeyc",
"request": "launch",
"name": "Run Optimized Release",
"stopAtLaunch": false,
"device": "${command:GetTargetDevice}",
"releaseBuild": true
},
{
"type": "omonkeyc",
"request": "launch",
"name": "Run Optimized Debug",
"stopAtLaunch": false,
"device": "${command:GetTargetDevice}",
"releaseBuild": false
}
]
}
Then, from the "Run and Debug" menu, you can select the one you want to run, and launch it. No need to change the settings. Note that you can put an actual device, rather than ${command:GetTargetDevice}
, if you don't want to have to choose the device every time you launch.
Note that the "monkeyc" config is handled by Garmin's extension, and doesn't support the "releaseBuild" flag, while the "omonkeyc" configs are handled by my extension.
In the same way, you can create build tasks, by putting something like this in .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"type": "omonkeyc",
"device": "choose",
"simulatorBuild": true,
"label": "Optimized Debug Build",
},
{
"type": "omonkeyc",
"device": "choose",
"simulatorBuild": true,
"label": "Optimized Release Build",
"releaseBuild": true
},
{
"type": "omonkeyc",
"device": "fenix5xplus",
"simulatorBuild": true,
"label": "Optimized Debug Fenix 5x Plus Build",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Note that vscode doesn't allow "commands" in tasks, so you use choose
here, rather than ${command:GetTargetDevice}
. Also, if you mark one task as the default build task, you can run it via Cmd-Shift-B.
Well, I guess I need to fix the extension to notice that you added a "-r" option. I'll try to fix that in the next release.
But meanwhile, the way I expected this to work is that you would put something like this in your .vscode/launch.json:
{ "version": "0.2.0", "configurations": [ { "type": "monkeyc", "request": "launch", "name": "Run Unoptimized", "stopAtLaunch": false, "device": "${command:GetTargetDevice}", }, { "type": "omonkeyc", "request": "launch", "name": "Run Optimized Release", "stopAtLaunch": false, "device": "${command:GetTargetDevice}", "releaseBuild": true }, { "type": "omonkeyc", "request": "launch", "name": "Run Optimized Debug", "stopAtLaunch": false, "device": "${command:GetTargetDevice}", "releaseBuild": false } ] }
Then, from the "Run and Debug" menu, you can select the one you want to run, and launch it. No need to change the settings. Note that you can put an actual device, rather than
${command:GetTargetDevice}
, if you don't want to have to choose the device every time you launch.Note that the "monkeyc" config is handled by Garmin's extension, and doesn't support the "releaseBuild" flag, while the "omonkeyc" configs are handled by my extension.
In the same way, you can create build tasks, by putting something like this in .vscode/tasks.json:
{ "version": "2.0.0", "tasks": [ { "type": "omonkeyc", "device": "choose", "simulatorBuild": true, "label": "Optimized Debug Build", }, { "type": "omonkeyc", "device": "choose", "simulatorBuild": true, "label": "Optimized Release Build", "releaseBuild": true }, { "type": "omonkeyc", "device": "fenix5xplus", "simulatorBuild": true, "label": "Optimized Debug Fenix 5x Plus Build", "group": { "kind": "build", "isDefault": true } } ] }
Note that vscode doesn't allow "commands" in tasks, so you use
choose
here, rather than${command:GetTargetDevice}
. Also, if you mark one task as the default build task, you can run it via Cmd-Shift-B.
thank you very much for your help! I did it by your code , and I'm totally a newbie using vscode =(
hi markw65: I tried to complie a release version by adding the option "-r" (change nothing but here)
and then I choose "build and run optiomized project" ,an Error appeared:
the code of Log module is :
what I can do to get it through? thank you ! :)