Skip to content

Tasks.json schema

Antonio Davide edited this page Mar 2, 2023 · 6 revisions
{
    version: "1.0.0", 

    tasks: [
      {
          name: "My Task", // Task name
          type: "shell|process", // Execute process from shell or directly
          default: true|false,  // Default task configuration

          // "command" can be set in various ways
          // 1)
          command: "echo 'Hello World'",
          // 2)
          command: "echo".
          args: ["'Hello World'"],
          // 3)
          command: ["echo 'Hello World 1'", "echo 'Hello World 2'"],
          // 4)
          command: [
            { command: "echo", args: ["'Hello World 1'"] },
            { command: "echo", args: ["'Hello World 2'"] },
          ],

          // OS Specific command
          "osname": { // vim.loop.os_uname().sysname:lower(): "windows", "linux", etc
              command: "ls", // See 'command' schema above
          },

          depends: ["List Dir"], // Execute task "List Dir" before "My Task"
      },
      {
          name: "List Dir",
          type: "shell",
          command: "ls",
          cwd: "${workspace_dir}" // ${...} will be replaced with its value before execution
      }
    ]
}
Clone this wiki locally