Skip to content

Tasks.json schema

Antonio Davide edited this page Jun 21, 2024 · 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": { // "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