LoginSignup
16
11

More than 5 years have passed since last update.

VSCodeでタスク実行時に複数コマンド実行

Last updated at Posted at 2018-02-06

Visual Studio Code: Task 機能に複数の任意のコマンドを簡単に仕込む方法 - Qiita という投稿がありましたが、最近のversionでは"dependsOn"プロパティを使って各タスクの依存関係を記述できます。

tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "cmake",
      "type": "shell",
      "command": "cmake",
      "args": [
        "."
      ]
    },
    {
      "label": "make",
      "type": "shell",
      "command": "make",
      "dependsOn": [
        "cmake"
      ]
    },
    {
      "label": "test",
      "type": "shell",
      "command": "make",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "dependsOn": [
        "make"
      ],
      "args": [
        "test"
      ]
    },
  ]
}

このほうがよりクリアかつ保守性もよいかと思います。

16
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
11