1
- $root = " $PSScriptRoot \.."
1
+ $root = ( Resolve-Path " $PSScriptRoot \.." ).Path
2
2
$artifactsDir = " $root \Artifacts"
3
- $nugetOutDir = " $root \Artifacts\NuGet"
4
- $logsDir = " $root \Artifacts\Logs"
5
- $testReportDir = " $root \Artifacts\TestResults"
6
- $testCoverageDir = " $root \Artifacts\Coverage"
7
- $nuget = " $root \Tools\NuGet.exe"
3
+ $nugetOutDir = " $artifactsDir \NuGet"
4
+ $logsDir = " $artifactsDir \Logs"
5
+ $testReportDir = " $artifactsDir \TestResults"
6
+ $testCoverageDir = " $artifactsDir \Coverage"
7
+ $toolsDir = " $root \.tools"
8
+
9
+ $nuget = " $toolsDir \NuGet.exe"
8
10
$vswhere = " ${env: ProgramFiles(x86)} \Microsoft Visual Studio\Installer\vswhere.exe"
9
11
$msbuildPath = & $vswhere - latest - products * - requires Microsoft.Component.MSBuild - property installationPath
12
+
10
13
if ($msbuildPath ) {
11
- $msbuild = join-path $msbuildPath ' MSBuild\Current\Bin\MSBuild.exe'
12
14
$msbuildx64 = join-path $msbuildPath ' MSBuild\Current\Bin\amd64\MSBuild.exe'
13
15
}
14
16
@@ -34,11 +36,7 @@ function Start-Build([boolean] $IncludeNanoFramework = $false) {
34
36
35
37
$fileLoggerArg = " /logger:FileLogger,Microsoft.Build;logfile=$logsDir \UnitsNet.msbuild.log"
36
38
37
- $appVeyorLoggerDll = " C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
38
- $appVeyorLoggerNetCoreDll = " C:\Program Files\AppVeyor\BuildAgent\dotnetcore\Appveyor.MSBuildLogger.dll"
39
- $appVeyorLoggerArg = if (Test-Path " $appVeyorLoggerNetCoreDll " ) { " /logger:$appVeyorLoggerNetCoreDll " } else { " " }
40
-
41
- dotnet build -- configuration Release / p:ContinuousIntegrationBuild= true " $root \UnitsNet.sln" $fileLoggerArg $appVeyorLoggerArg
39
+ dotnet build -- configuration Release / p:ContinuousIntegrationBuild= true " $root \UnitsNet.sln" $fileLoggerArg
42
40
if ($lastexitcode -ne 0 ) { exit 1 }
43
41
44
42
if (-not $IncludeNanoFramework )
@@ -49,12 +47,12 @@ function Start-Build([boolean] $IncludeNanoFramework = $false) {
49
47
{
50
48
write-host - foreground green " Build .NET nanoFramework."
51
49
$fileLoggerArg = " /logger:FileLogger,Microsoft.Build;logfile=$logsDir \UnitsNet.NanoFramework.msbuild.log"
52
- $appVeyorLoggerArg = if (Test-Path " $appVeyorLoggerDll " ) { " /logger:$appVeyorLoggerDll " } else { " " }
53
50
54
51
# msbuild does not auto-restore nugets for this project type
55
52
& " $nuget " restore " $root \UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln"
53
+
56
54
# now build
57
- & " $msbuildx64 " " $root \UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln" / verbosity:minimal / p:Configuration= Release / p:Platform= " Any CPU" / p:ContinuousIntegrationBuild= true $fileLoggerArg $appVeyorLoggerArg
55
+ & " $msbuildx64 " " $root \UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln" / verbosity:minimal / p:Configuration= Release / p:Platform= " Any CPU" / p:ContinuousIntegrationBuild= true $fileLoggerArg
58
56
if ($lastexitcode -ne 0 ) { exit 1 }
59
57
}
60
58
@@ -95,7 +93,7 @@ function Start-Tests {
95
93
}
96
94
97
95
# Generate a summarized code coverage report for all test projects
98
- & " Tools /reportgenerator.exe" - reports:" $root /Artifacts/Coverage/ *.coverage.xml" - targetdir:" $root /Artifacts/Coverage " - reporttypes:HtmlSummary
96
+ & " $toolsDir /reportgenerator.exe" - reports:" $testCoverageDir / *.coverage.xml" - targetdir:" $testCoverageDir " - reporttypes:HtmlSummary
99
97
100
98
write-host - foreground blue " Run tests...END`n "
101
99
}
0 commit comments