Add some task definitions to run mach from VSCode (bug 1323308). r?gps draft
authorPanos Astithas <past@mozilla.com>
Thu, 04 May 2017 18:03:54 +0300
changeset 572739 bf9e8a51d33159be252cbd3369a817304780b7e5
parent 572570 33b92d9c40562dab3d7b602368c75619f1d793f7
child 627115 35fa98c5e8324a7fa1ea3becb716bf93a7ff8ecd
push id57172
push userbmo:past@mozilla.com
push dateThu, 04 May 2017 17:29:28 +0000
reviewersgps
bugs1323308
milestone55.0a1
Add some task definitions to run mach from VSCode (bug 1323308). r?gps MozReview-Commit-ID: EVFFHmgHRL2
.gitignore
.hgignore
.vscode/tasks.json
--- a/.gitignore
+++ b/.gitignore
@@ -123,10 +123,11 @@ testing/talos/talos/tests/devtools/damp.
 
 # Ignore files created when running a reftest.
 lextab.py
 
 # tup database
 /.tup
 
 # Ignore Visual Studio Code workspace files.
-.vscode/
+.vscode/*
 !.vscode/extensions.json
+!.vscode/tasks.json
--- a/.hgignore
+++ b/.hgignore
@@ -136,14 +136,14 @@ GPATH
 
 # Ignore files created when running a reftest.
 ^lextab.py$
 
 # tup database
 ^\.tup
 
 # Ignore Visual Studio Code workspace files.
-\.vscode/(?!extensions.json$)
+\.vscode/(?!extensions\.json|tasks\.json)
 
 subinclude:servo/.hgignore
 
 # Ignore Infer output
-^infer-out/
\ No newline at end of file
+^infer-out/
new file mode 100644
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,165 @@
+{
+    // See https://go.microsoft.com/fwlink/?LinkId=733558
+    // for the documentation about the tasks.json format
+    "version": "2.0.0",
+    "command": "${workspaceRoot}/mach",
+    "isShellCommand": true,
+    "args": ["--log-no-times"],
+    "showOutput": "silent",
+    "echoCommand": true,
+    "suppressTaskName": false,
+    "tasks": [
+      {
+        "taskName": "clobber"
+      },
+      {
+        "taskName": "configure"
+      },
+      {
+        "taskName": "build",
+        "isBuildCommand": true,
+        "problemMatcher": {
+          "owner": "cpp",
+          "fileLocation": "absolute",
+          "pattern": {
+            "regexp": "^.*?tools([^\\s]*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
+            "file": 1,
+            "line": 2,
+            "column": 3,
+            "severity": 4,
+            "message": 5
+          }
+        }
+      },
+      {
+        "taskName": "build binaries",
+        "problemMatcher": {
+          "owner": "cpp",
+          "fileLocation": "absolute",
+          "pattern": {
+            "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
+            "file": 1,
+            "line": 2,
+            "column": 3,
+            "severity": 4,
+            "message": 5
+          }
+        }
+      },
+      {
+        "taskName": "build faster",
+        "problemMatcher": {
+          "owner": "cpp",
+          "fileLocation": "absolute",
+          "pattern": {
+            "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
+            "file": 1,
+            "line": 2,
+            "column": 3,
+            "severity": 4,
+            "message": 5
+          }
+        }
+      },
+      {
+        "taskName": "run",
+        "args": ["-purgecaches"],
+        "showOutput": "always"
+      },
+      {
+        "taskName": "eslint",
+        "problemMatcher": {
+          "owner": "javascript",
+          "fileLocation": ["absolute"],
+          "pattern": [
+              {
+                  "regexp": "^([^\\s].*)$",
+                  "file": 1
+              },
+              {
+                  "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
+                  "line": 1,
+                  "column": 2,
+                  "severity": 3,
+                  "message": 4,
+                  "code": 5,
+                  "loop": true
+              }
+          ]
+        }
+      },
+      {
+        "taskName": "eslint fix",
+        "suppressTaskName": true,
+        "args": ["eslint", "--fix", "${file}"],
+        "problemMatcher": {
+          "owner": "javascript",
+          "fileLocation": ["absolute"],
+          "pattern": [
+              {
+                  "regexp": "^([^\\s].*)$",
+                  "file": 1
+              },
+              {
+                  "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
+                  "line": 1,
+                  "column": 2,
+                  "severity": 3,
+                  "message": 4,
+                  "code": 5,
+                  "loop": true
+              }
+          ]
+        }
+      },
+      {
+        "taskName": "test",
+        "args": ["${relativeFile}"],
+        "isTestCommand": true,
+        "showOutput": "always"
+      },
+      {
+        "taskName": "mochitest",
+        "args": ["${relativeFile}"],
+        "showOutput": "always",
+        "problemMatcher": {
+          "fileLocation": ["relative", "${workspaceRoot}"],
+          "pattern": {
+              "regexp": "^.*\\s+(TEST-UNEXPECTED-FAIL|TEST-UNEXPECTED-PASS)\\s+\\|\\s+([^\\s]*)\\s+\\|\\s+(.*)$",
+              "severity": 1,
+              "file": 2,
+              "message": 3
+          }
+        }
+      },
+      {
+        "taskName": "reftest",
+        "args": ["${relativeFile}"],
+        "showOutput": "always",
+        "problemMatcher": {
+          "fileLocation": ["absolute"],
+          "pattern": {
+              "regexp": "^.*\\s+(TEST-UNEXPECTED-FAIL|TEST-UNEXPECTED-PASS)\\s+\\|\\s+file:\/\/([^\\s]*)\\s+==\\s+[^\\s]*\\s+\\|\\s+(.*)$",
+              "severity": 1,
+              "file": 2,
+              "message": 3
+          }
+        }
+      },
+      {
+        "taskName": "xpcshell-test",
+        "args": ["${relativeFile}", "--sequential"],
+        "showOutput": "always",
+        "problemMatcher": {
+          "fileLocation": ["relative", "${workspaceRoot}"],
+          "pattern": {
+              "regexp": "^.*\\s+(FAIL|ERROR)\\s+\\[([^\\s]*)\\s+:\\s+(\\d+)\\]\\s+(.*)$",
+              "severity": 1,
+              "file": 2,
+              "location": 3,
+              "message": 4
+          }
+        }
+      }
+    ]
+}