1
1
function Start-Build {
2
2
param ( [switch ]$CoreOnly )
3
- $versions = 3 , 5
3
+ # $versions = 3,5
4
+ $versions = 5
4
5
$srcBase = Join-Path $PsScriptRoot src
5
6
foreach ( $version in $versions ) {
6
7
try {
7
8
$srcDir = Join-Path $srcBase $version
8
9
Push-Location $srcDir
9
- dotnet restore
10
+ Write-Verbose - Verbose " restoring in $srcDir "
11
+ $result = dotnet restore
12
+ if ( ! $? ) { throw " $result " }
10
13
if ( $CoreOnly ) {
11
- dotnet build -- configuration Release -- framework netstandard2.0
14
+ Write-Verbose - Verbose " building netstandard in $srcDir "
15
+ $result = dotnet build -- configuration Release -- framework netstandard2.0
16
+ if ( ! $? ) { throw " $result " }
12
17
}
13
18
else {
14
- dotnet build -- configuration Release
19
+ Write-Verbose - Verbose " building default in $srcDir "
20
+ $result = dotnet build -- configuration Release
21
+ if ( ! $? ) { throw " $result " } else { Write-Verbose - Verbose " $result " }
15
22
}
16
23
}
17
24
finally {
@@ -23,8 +30,12 @@ function Start-Build {
23
30
try {
24
31
$templateBase = Join-Path $srcBase dotnetTemplate
25
32
Push-Location $templateBase
26
- dotnet restore
27
- dotnet build -- configuration Release
33
+ Write-Verbose - Verbose " restoring in $templateBase "
34
+ $result = dotnet restore
35
+ if ( ! $? ) { throw " $result " }
36
+ Write-Verbose - Verbose " building in $templateBase "
37
+ $result = dotnet build -- configuration Release
38
+ if ( ! $? ) { throw " $result " } else { Write-Verbose - Verbose " $result " }
28
39
}
29
40
finally {
30
41
Pop-Location
@@ -41,7 +52,9 @@ function Start-Clean {
41
52
try {
42
53
$fileDir = Join-Path $baseDir $version
43
54
Push-Location $fileDir
44
- dotnet clean
55
+ " Cleaning in $fileDir "
56
+ $result = dotnet clean
57
+ if ( ! $? ) { write-error " $result " }
45
58
if ( test-path obj ) { remove-item - recurse - force obj }
46
59
if ( test-path bin ) { remove-item - recurse - force bin }
47
60
remove-item " PowerShellStandard.Library.${version} *.nupkg" - ErrorAction SilentlyContinue
@@ -77,11 +90,13 @@ function Invoke-Test {
77
90
try {
78
91
Push-Location $framework
79
92
if ( $CoreOnly ) {
80
- dotnet build -- configuration Release -- framework netstandard2.0
93
+ $result = dotnet build -- configuration Release -- framework netstandard2.0
94
+ if ( ! $? ) { throw " $result " }
81
95
Invoke-Pester
82
96
}
83
97
else {
84
- dotnet build -- configuration Release
98
+ $result = dotnet build -- configuration Release
99
+ if ( ! $? ) { throw " $result " }
85
100
Invoke-Pester
86
101
}
87
102
}
@@ -108,12 +123,14 @@ function Export-NuGetPackage
108
123
{
109
124
# create the package
110
125
# it will automatically build
111
- $versions = 3 , 5
126
+ # $versions = 3,5
127
+ $versions = 5
112
128
$srcBase = Join-Path $PsScriptRoot src
113
129
foreach ( $version in $versions ) {
114
130
try {
115
131
$srcDir = Join-Path $srcBase $version
116
132
Push-Location $srcDir
133
+ Write-Verbose - Verbose " Creating nupkg for $version "
117
134
$result = dotnet pack -- configuration Release
118
135
if ( $? ) {
119
136
Copy-Item - verbose:$true (Join-Path $srcDir " bin/Release/PowerShellStandard.Library*.nupkg" ) $PsScriptRoot
@@ -130,6 +147,7 @@ function Export-NuGetPackage
130
147
try {
131
148
$templateDir = Join-Path $PsScriptRoot src/ dotnetTemplate
132
149
Push-Location $templateDir
150
+ Write-Verbose - Verbose " creating nupkg in $templateDir "
133
151
$result = dotnet pack -- configuration Release
134
152
if ( $? ) {
135
153
Copy-Item - verbose:$true (Join-Path $templateDir " bin/Release/*.nupkg" ) $PsScriptRoot
0 commit comments