@@ -11,7 +11,7 @@ if ($msbuild) {
11
11
12
12
function Remove-ArtifactsDir {
13
13
write-host - foreground blue " Clean up...`n "
14
- rm $artifactsDir - Recurse - ErrorAction Ignore
14
+ rm $artifactsDir - Recurse - Force - ErrorAction Stop
15
15
write-host - foreground blue " Clean up...END`n "
16
16
}
17
17
@@ -23,10 +23,17 @@ function Update-GeneratedCode {
23
23
& " $root \UnitsNet\Scripts\GenerateUnits.ps1"
24
24
if ($lastexitcode -ne 0 ) { exit 1 }
25
25
26
+ if (-not $IncludeWindowsRuntimeComponent ) {
27
+ write-host - foreground yellow " Skipping WindowsRuntimeComponent code regen."
28
+ } else {
29
+ & " $root \UnitsNet.WindowsRuntimeComponent\Scripts\GenerateUnits.ps1"
30
+ if ($lastexitcode -ne 0 ) { exit 1 }
31
+ }
32
+
26
33
write-host - foreground blue " Generate code...END`n "
27
34
}
28
35
29
- function Start-Build ([boolean ] $skipUWP = $false ) {
36
+ function Start-Build ([boolean ] $IncludeWindowsRuntimeComponent = $false ) {
30
37
write-host - foreground blue " Start-Build...`n ---"
31
38
32
39
$fileLoggerArg = " /logger:FileLogger,Microsoft.Build;logfile=$testReportDir \UnitsNet.msbuild.log"
@@ -38,9 +45,9 @@ function Start-Build([boolean] $skipUWP = $false) {
38
45
dotnet build -- configuration Release " $root \UnitsNet.sln" $fileLoggerArg $appVeyorLoggerArg
39
46
if ($lastexitcode -ne 0 ) { exit 1 }
40
47
41
- if ($skipUWP -eq $true )
48
+ if (-not $IncludeWindowsRuntimeComponent )
42
49
{
43
- write-host - foreground yellow " Skipping WindowsRuntimeComponent build by user-specified flag ."
50
+ write-host - foreground yellow " Skipping WindowsRuntimeComponent build."
44
51
}
45
52
else
46
53
{
@@ -98,8 +105,12 @@ function Start-PackNugets {
98
105
if ($lastexitcode -ne 0 ) { exit 1 }
99
106
}
100
107
101
- write-host - foreground yellow " WindowsRuntimeComponent project not yet supported by dotnet CLI, using nuget.exe instead"
102
- & $nuget pack " $root \UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRuntimeComponent.nuspec" - Verbosity detailed - OutputDirectory " $nugetOutDir "
108
+ if (-not $IncludeWindowsRuntimeComponent ) {
109
+ write-host - foreground yellow " Skipping WindowsRuntimeComponent nuget pack."
110
+ } else {
111
+ write-host - foreground yellow " WindowsRuntimeComponent project not yet supported by dotnet CLI, using nuget.exe instead"
112
+ & $nuget pack " $root \UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRuntimeComponent.nuspec" - Verbosity detailed - OutputDirectory " $nugetOutDir "
113
+ }
103
114
104
115
write-host - foreground blue " Pack nugets...END`n "
105
116
}
0 commit comments