-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from supermemo/project-infrastructure-2.1.0
Project infrastructure 2.1.0
- Loading branch information
Showing
234 changed files
with
3,802 additions
and
3,158 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 @@ | ||
.githooks-src |
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 @@ | ||
#!/usr/bin/env powershell |
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,55 @@ | ||
try { | ||
$prefixes = @( | ||
"- Added", | ||
"- Removed", | ||
"- Updated", | ||
"- Fixed", | ||
"- Misc" | ||
) | ||
|
||
# $args[0] should contain the path to a file with the user's commit message | ||
if (!(Test-Path $args[0])) { | ||
Write-Host "An error occured while verifying commit message: the commit message file '$args[0]' doesn't exist." | ||
exit 1 | ||
} | ||
|
||
# Parse the file's commit message | ||
$errors = New-Object Collections.Generic.List[string] | ||
[int] $i = 1 | ||
|
||
foreach ($line in [string[]] (Get-Content $args[0])) { | ||
$line = $line.Trim(); | ||
|
||
if ($prefixes.Where({ $line.StartsWith($_) }).Count -eq 0) { | ||
$errors.Add("[line $i] Missing prefix in '$line'") | ||
} | ||
|
||
$i++ | ||
} | ||
|
||
# If any error, display error message & fail | ||
if ($errors.Count -gt 0) | ||
{ | ||
$red="" | ||
$nocolor="" | ||
|
||
$errMsg = @" | ||
Errors: | ||
$($errors -Join "`n") | ||
Your commit lines should start with one of those prefixes: | ||
'$($prefixes -Join "'; '")' | ||
/!\ ERROR: Your commit message contained errors. Read above for more details. | ||
"@ | ||
Write-Host -ForegroundColor Red $errMsg | ||
|
||
exit 1 | ||
} | ||
|
||
exit 0 | ||
} | ||
catch { | ||
Write-Host "An error occured while verifying commit message: $_" | ||
exit -1 | ||
} |
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 @@ | ||
#!/usr/bin/env powershell |
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,45 @@ | ||
try { | ||
# https://github.com/Microsoft/vswhere/wiki/Find-MSBuild | ||
function Find-MSBuild( [string] $vswhere ) { | ||
return & $vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1 | ||
} | ||
|
||
# https://github.com/microsoft/vswhere/wiki/Find-VSTest | ||
function Find-VSTest( [string] $vswhere ) { | ||
$path = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.Web -requiresAny -property installationPath | ||
return Join-Path $path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' | ||
} | ||
|
||
# Recursively search for all .csproj files under the src folder | ||
function Find-Projects { | ||
return Get-ChildItem -Path src -Filter "*.csproj" -Recurse -ErrorAction SilentlyContinue -Force | ||
} | ||
|
||
# Run tests on the given projects | ||
function Run-Tests ( [string] $vstest, [string[]] $projects ) { | ||
# | ||
|
||
& $vstest $projectDlls "/InIsolation" "/Logger:trx" | ||
} | ||
|
||
# Get MSBuild | ||
# $vswhere = "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" | ||
|
||
# $vstest = Find-VSTest $vswhere | ||
# $msbuild = Find-MSBuild $vswhere | ||
|
||
# Find all the projects | ||
# $projects = Find-Projects | ||
|
||
# TODO: Build projects | ||
# | ||
|
||
# Run tests | ||
# $testResults = Run-Tests $vstest $projects | ||
|
||
exit 0 | ||
} | ||
catch { | ||
Write-Host "An error occured while verifying commit: $_" | ||
exit -1 | ||
} |
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
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
Oops, something went wrong.