Skip to content

Commit

Permalink
Updated BuildToolkit to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeuchler committed Nov 17, 2021
1 parent 3999aa3 commit 63786a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 17 additions & 5 deletions .build/BuildToolkit.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Tool Versions
$NunitVersion = "3.12.0";
$OpenCoverVersion = "4.7.922";
$DocFxVersion = "2.56.2";
$ReportGeneratorVersion = "4.8.7";
$OpenCoverVersion = "4.7.1221";
$DocFxVersion = "2.58.4";
$ReportGeneratorVersion = "4.8.13";
$OpenCoverToCoberturaVersion = "0.3.4";

# Folder Pathes
$RootPath = $MyInvocation.PSScriptRoot;
Expand All @@ -18,6 +19,7 @@ $DocumentationArtifcacts = "$ArtifactsDir\Documentation";
# Tests
$NunitReportsDir = "$ArtifactsDir\Tests";
$OpenCoverReportsDir = "$ArtifactsDir\Tests"
$CoberturaReportsDir = "$ArtifactsDir\Tests"

# Nuget
$NugetConfig = "$RootPath\NuGet.Config";
Expand All @@ -34,6 +36,7 @@ $global:OpenCoverCli = "$BuildTools\OpenCover.$OpenCoverVersion\tools\OpenCover.
$global:NunitCli = "$BuildTools\NUnit.ConsoleRunner.$NunitVersion\tools\nunit3-console.exe";
$global:ReportGeneratorCli = "$BuildTools\ReportGenerator.$ReportGeneratorVersion\tools\net47\ReportGenerator.exe";
$global:DocFxCli = "$BuildTools\docfx.console.$DocFxVersion\tools\docfx.exe";
$global:OpenCoverToCoberturaCli = "$BuildTools\OpenCoverToCoberturaConverter.$OpenCoverToCoberturaVersion\tools\OpenCoverToCoberturaConverter.exe";

# Git
$global:GitCommitHash = "";
Expand Down Expand Up @@ -132,6 +135,7 @@ function Invoke-Initialize([string]$Version = "1.0.0", [bool]$Cleanup = $False)
Write-Variable "NUnitCli" $global:NUnitCli;
Write-Variable "ReportGeneratorCli" $global:ReportGeneratorCli;
Write-Variable "DocFxCli" $global:DocFxCli;
Write-Variable "OpenCoverToCoberturaCli" $global:OpenCoverToCoberturaCli;
Write-Variable "GitCli" $global:GitCli;
Write-Variable "GitCommitHash" $global:GitCommitHash;

Expand Down Expand Up @@ -269,6 +273,10 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",
Install-Tool "OpenCover" $OpenCoverVersion $global:OpenCoverCli;
}

if (-not (Test-Path $global:OpenCoverToCoberturaCli)) {
Install-Tool "OpenCoverToCoberturaConverter" $OpenCoverToCoberturaVersion $global:OpenCoverToCoberturaCli;
}

CreateFolderIfNotExists $OpenCoverReportsDir;
CreateFolderIfNotExists $NunitReportsDir;

Expand Down Expand Up @@ -308,6 +316,7 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",

$nunitXml = ($NunitReportsDir + "\$projectName.TestResult.xml");
$openCoverXml = ($OpenCoverReportsDir + "\$projectName.OpenCover.xml");
$coberturaXml = ($CoberturaReportsDir + "\$projectName.Cobertura.xml");

if ($isNetCore) {
$targetArgs = '"test -v ' + $env:MORYX_TEST_VERBOSITY + ' -c ' + $env:MORYX_BUILD_CONFIG + ' ' + $testProject + '"';
Expand Down Expand Up @@ -346,6 +355,9 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",
Write-Host-Error "Nunit exited with $errorText for $projectName";
Invoke-ExitCodeCheck $exitCode;
}

& $global:OpenCoverToCoberturaCli -input:$openCoverXml -output:$coberturaXml -sources:$rootPath
Invoke-ExitCodeCheck $LastExitCode;
}
}

Expand Down Expand Up @@ -655,7 +667,7 @@ function CreateFolderIfNotExists([string]$Folder) {
}

function CopyAndReplaceFolder($SourceDir, $TargetDir) {
Write-Host-Info "Copy $TargetDir to $SourceDir!"
Write-Host-Info "Copy $SourceDir to $TargetDir!"
# Remove old folder if exists
if (Test-Path $TargetDir) {
Write-Host "Target path already exists, removing ..." -ForegroundColor Yellow
Expand All @@ -665,4 +677,4 @@ function CopyAndReplaceFolder($SourceDir, $TargetDir) {
# Copy to target path
Write-Host "Copy from $SourceDir to $TargetDir ..." -ForegroundColor Green
Copy-Item -Path $SourceDir -Recurse -Destination $TargetDir -Container
}
}
12 changes: 0 additions & 12 deletions .build/Global.DotSettings

This file was deleted.

0 comments on commit 63786a9

Please sign in to comment.