Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Commit

Permalink
* добавлен problemMatcher для ошибок make (#49) [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-s-betke committed Jun 19, 2018
1 parent 5ae1373 commit bc7bbc2
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 20 deletions.
44 changes: 44 additions & 0 deletions .vscode/Resolve-PathInGNUMakeLog.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<#
.Synopsis
Преобразует относительные имена файлов в выводе GNU Make в абсолютные.
.Description
Преобразует относительные имена файлов в выводе GNU Make в абсолютные.
.Example
make 2>&1 | .\.vscode\Resolve-PathInGNUMakeLog.ps1;
#>
[CmdletBinding(
SupportsShouldProcess = $false
)]

param (
# Строка вывода GNU Make.
[Parameter(
Mandatory = $true
, ValueFromPipeline = $true
)]
[ValidateNotNull()]
[Alias('GNUMakeOutput')]
[String]
$InputObject
)

process {
$ErrorActionPreference = 'Continue';
Switch -Regex ( $_ ) {
'make(?:\.exe)?\s+.*?-C\s+(?<subDir>\S+)' {
Push-Location $Matches['subDir'];
$_
}
'^make\[\d+\]: Leaving directory ''(?<subDir>.+?)''' {
Pop-Location;
$_
}
'^(.+?):(\d+):\s+(.*?) Stop.$' {
$_ -replace '^(.+?)(?=:)', "$( Join-Path (Get-Location) '$1')"
}
'^make: \*\*\* \[(?<fileName>\S+?):(?<line>\d+):\s*(.*?)\]\s+(?<saverity>Error|Warning)\s+(?<code>\d+)$' {
$_ -replace '(?<=make: \*\*\* \[)(\S+?)(?=:)', "$( Join-Path (Get-Location) '$1')"
} `
default { $_ }
};
}
58 changes: 38 additions & 20 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
{
"label": "Выполнить сборку",
"type": "shell",
"command": "make",
"windows": {
"command": "cmd /c 'make 2>&1' | .\\.vscode\\Resolve-PathInGNUMakeLog.ps1",

This comment has been minimized.

Copy link
@sergey-s-betke

sergey-s-betke Jun 19, 2018

Author Contributor
},
"linux": {
"command": "/bin/sh -c 'make 2>&1' | .\\.vscode\\Resolve-PathInGNUMakeLog.ps1",

This comment has been minimized.

Copy link
@sergey-s-betke

sergey-s-betke Jun 19, 2018

Author Contributor
},
"group": {
"kind": "build",
"isDefault": true
Expand All @@ -26,21 +31,30 @@
"reveal": "always",
"panel": "shared"
},
"problemMatcher": {
"fileLocation": ["relative", "${workspaceFolder}"],

"pattern": {
"regexp": "^([^\\s].*?):(\\d+|):\\s+(.*?) Stop.$",
"file": 1,
"line": 2,
"message": 3
"problemMatcher": [
{
"owner": "custom",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^(.+?):(\\d+):\\s+(.*?) Stop\\.$",
"file": 1,
"line": 2,
"message": 3
}
]
}
}
]
},
{
"label": "Выполнить тесты",
"type": "shell",
"command": "make check",
"windows": {
"command": "cmd /c 'make check 2>&1' | .\\.vscode\\Resolve-PathInGNUMakeLog.ps1",

This comment has been minimized.

Copy link
@sergey-s-betke

sergey-s-betke Jun 19, 2018

Author Contributor
},
"linux": {
"command": "/bin/sh -c 'make check 2>&1' | .\\.vscode\\Resolve-PathInGNUMakeLog.ps1",

This comment has been minimized.

Copy link
@sergey-s-betke

sergey-s-betke Jun 19, 2018

Author Contributor
},
"group": {
"kind": "test",
"isDefault": true
Expand All @@ -49,16 +63,20 @@
"reveal": "always",
"panel": "shared"
},
"problemMatcher": {
"fileLocation": ["relative", "${workspaceFolder}"],

"pattern": {
"regexp": "^([^\\s].*?):(\\d+|):\\s+(.*?) Stop.$",
"file": 1,
"line": 2,
"message": 3
"problemMatcher": [
{
"owner": "custom",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^(.+?):(\\d+):\\s+(.*?) Stop\\.$",
"file": 1,
"line": 2,
"message": 3
}
]
}
}
]
},
{
"label": "Отправить изменения в ITG.MakeUtils",
Expand Down

0 comments on commit bc7bbc2

Please sign in to comment.