在启动时运行多个任务

时间:2016-12-09 06:41:52

标签: visual-studio-code

我有以下tasks.json

http://127.0.0.1:8000/api/tool/?District=Pune

并启动.json:

{
  "version": "0.1.0",
  "command": "mvn",
  "isShellCommand": true,
  "args": [],
  "showOutput": "always",
  "tasks": [
    {
      "taskName": "compile"
    },
    {
      "taskName": "package"
    }
  ]   
}

如您所见,{ "version": "0.2.0", "configurations": [ { "name": "Java", "type": "java", "request": "launch", "stopOnEntry": true, "cwd": "${fileDirname}", // ${fileDirname}: the current opened file's dirname "startupClass": "myapp.${fileBasename}", // ${fileBasename}: the current opened file's basename "options": [ "-classpath", "${workspaceRoot}/target/classes;${workspaceRoot}/target/classes/lib/*" // ${fileDirname}: the current opened file's dirname ], "jdkPath": "${env.JAVA_HOME}/bin", // ${env.JAVA_HOME}: reference environment variables "preLaunchTask": "compile" } ] } 命令已预先启动。但是我如何定义mutliple命令呢?我想运行compile然后package,而不仅仅是compile

1 个答案:

答案 0 :(得分:1)

使用以下任务定义来调用编译目标。

{
   "taskName": "compile",
   "args": ["-B", "package","compile"],
   "isBuildCommand": true
}