VSCode Config to build only (no launch; no sim start)

Is that possible?

My config currently looks like following:

{
    "type": "monkeyc",
    "request": "launch",
    "name": "F7X Pro",
    "stopAtLaunch": false,
    "device": "fenix7xpro"
}

I would like to add a second config like "Build for F7X Pro" that simply builds the project for the device but does not start the sim, just to quickly test that everything builds correctly for the device.

  • Based on playing with intellisense / auto-complete (CTRL-SPACE) to see available options for a monkey c launch config with minimal contents ({ "type": "monkeyc" }), I don't think it's directly possible via the monkey c extension.

    Not *exactly* what you're looking for, but you could define a launch config to run a command in the terminal (such as an SDK build command).

    [https://developer.garmin.com/connect-iq/reference-guides/monkey-c-command-line-setup/]

    [https://stackoverflow.com/questions/43836861/how-to-run-a-command-in-visual-studio-code-with-launch-json]

  • I think it's possible using the tasks.json

    {
      // See https://go.microsoft.com/fwlink/?LinkId=733558
      // for the documentation about the tasks.json format
      "version": "2.0.0",
      "tasks": [
        {
          "type": "omonkeyc",
          "device": "fenix6",
          "simulatorBuild": false,
          "releaseBuild": false,
          "label": "fenix6 Device DEBUG Build",
          "group": {
            "kind": "build",
            "isDefault": true
          }
        },
        {
          "type": "omonkeyc",
          "device": "fenix6",
          "simulatorBuild": false,
          "releaseBuild": true,
          "label": "fenix6 Device Release Build",
          "group": {
            "kind": "build",
            "isDefault": true
          }
        },
        {
          "type": "omonkeyc",
          "device": "fr245",
          "simulatorBuild": false,
          "releaseBuild": true,
          "label": "fr245 Device Build",
          "group": {
            "kind": "build",
            "isDefault": true
          }
        },
        {
          "type": "omonkeyc",
          "device": "fr965",
          "simulatorBuild": false,
          "releaseBuild": true,
          "label": "fr965 Device Build",
          "group": {
            "kind": "build",
            "isDefault": true
          }
        },
        {
          "type": "omonkeyc",
          "device": "edgeexplore2",
          "simulatorBuild": false,
          "releaseBuild": true,
          "label": "edgeexplore2 Device Build",
          "group": {
            "kind": "build",
            "isDefault": true
          }
        }
      ]
    }
    

    Though this uses Prettier Monkey C. It might need some improvements from Garmin's side to be able to pass some new parameters to the Garmin compiler. Maybe this would also help: forums.garmin.com/.../feature-request-add-args-to-monkeyc-in-launch-json

  • Thanks, that helped. I am not using the prettier extension yet but was planing to use it anyways.

  • My task currently looks like following:

    {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "tasks": [
            {
                "type": "omonkeyc",
                "device": "fenix7xpro",
                "simulatorBuild": false,
                "releaseBuild": false,
    
                "checkInvalidSymbols": "OFF",
                //"checkTypes": "OFF",
                "sizeBasedPRE":false,
                "trustDeclaredTypes":true,
                "propagateTypes":false,
                "minimizeLocals": false,
                "minimizeModules": false,
                "singleUseCopyProp": false,
                "iterateOptimizer": false,
                "postBuildOptimizer": false,
                "removeArgc": false,
                "allowForbiddenOpts": false,
                "postBuildPRE": false,
                "enforceStatic": "NO",
                "useLocalOptimizer": false,
    
                "label": "F7X Pro (BUILD ONLY)",
                "group": {
                    "kind": "build",
                    "isDefault": true
                }
            }
        ]
    }

    I disabled nearly everything but still the code gets partly optimised. My use case is to see the error lines inside my non optimised code if it fails - any idea if I can fully disable any optimisation? I think in my case (:inline) is one thing that is not disabled yet and maybe more.

  • But inlining only happens when you use :inline annotation, so it's easy not to use it :)