forked from stackify/stackify-api-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
74 lines (56 loc) · 2.58 KB
/
Copy pathbuild.ps1
File metadata and controls
74 lines (56 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function CheckLastExitCode {
param ([int[]]$SuccessCodes = @(0), [scriptblock]$CleanupScript=$null)
if ($SuccessCodes -notcontains $LastExitCode) {
$msg = "EXE RETURNED EXIT CODE $LastExitCode"
throw $msg
}
}
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)
dotnet restore .\Src
Write-Output "Building StackifyLib"
dotnet build .\Src\StackifyLib -c Release
CheckLastExitCode
Write-Output "Building StackifyLib"
dotnet build .\Src\StackifyLib -c Release
CheckLastExitCode
Write-Output "Building NLog.Targets.Stackify"
dotnet build .\Src\NLog.Targets.Stackify -c Release
CheckLastExitCode
Write-Output "Building StackifyLib.CoreLogger"
dotnet build .\Src\StackifyLib.CoreLogger -c Release
CheckLastExitCode
# Write-Output "Building StackifyLib.ELMAH"
# dotnet build .\Src\StackifyLib.ELMAH -c Release
Write-Output "Building StackifyLib.log4net"
dotnet build .\Src\StackifyLib.log4net -c Release
CheckLastExitCode
# Write-Output "Building StackifyLib.log4net.Sitecore"
# dotnet build .\Src\StackifyLib.log4net.Sitecore -c Release
# Write-Output "Building StackifyLib.log4net.Tests"
# dotnet build .\Src\StackifyLib.log4net.Tests -c Release
# Write-Output "Building StackifyLib.log4net.v1_2_10"
# dotnet build .\Src\StackifyLib.log4net.v1_2_10 -c Release
# Write-Output "Building StackifyLib.nlog"
# dotnet build .\Src\StackifyLib.nlog -c Release
# Write-Output "Building StackifyLib.NoWeb"
# dotnet build .\Src\StackifyLib.NoWeb -c Release
Write-Output "Building StackifyLib.StackifyTraceListener"
dotnet build .\Src\StackifyLib.StackifyTraceListener -c Release
CheckLastExitCode
Write-Output "Testing StackifyLib"
dotnet restore .\test\StackifyLibTests\StackifyLibTests.csproj
dotnet test .\test\StackifyLibTests\StackifyLibTests.csproj
CheckLastExitCode
Write-Output "APPVEYOR_REPO_TAG: $env:APPVEYOR_REPO_TAG"
Write-Output "VERSION-SUFFIX: alpha1-$revision"
If($env:APPVEYOR_REPO_TAG -eq $true) {
Write-Output "RUNNING dotnet pack .\Src\StackifyLib -c Release -o .\artifacts "
dotnet pack .\Src\StackifyLib -c Release -o .\artifacts
dotnet pack .\Src\StackifyLib.log4net -c Release -o .\artifacts
}
Else { # publish pre-release if it does not have a tag
Write-Output "RUNNING dotnet pack .\Src\StackifyLib -c Release -o .\artifacts --version-suffix=beta1-$revision"
dotnet pack .\Src\StackifyLib -c Release -o .\artifacts --version-suffix=beta1-$revision
dotnet pack .\Src\StackifyLib.log4net -c Release -o .\artifacts --version-suffix=beta1-$revision
}