This repository has been archived by the owner on Jul 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* добавлен problemMatcher для ошибок make (#49) [ci skip]
- Loading branch information
1 parent
5ae1373
commit bc7bbc2
Showing
2 changed files
with
82 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { $_ } | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Из-за PowerShell/PowerShell#5424.