-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathBuild.ps1
53 lines (30 loc) · 1.89 KB
/
Build.ps1
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
Push-Location $PSScriptRoot
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
& dotnet restore
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
echo "build: Version suffix is '$suffix'"
Push-Location src\MessageTemplates
# always use revision for now, need to fix before 1.0 release
& dotnet pack -c Release --include-symbols --include-source -o ..\..\artifacts --version-suffix=$revision
if($LASTEXITCODE -ne 0) { exit 1 }
Pop-Location
Push-Location test\MessageTemplates.Tests
& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 2 }
Pop-Location
Push-Location test\MessageTemplates.Net40Tests
&nuget install ..\..\test\MessageTemplates.Net40Tests\packages.config -SolutionDirectory ..\..\
&msbuild ..\..\test\MessageTemplates.Net40Tests\MessageTemplates.Net40Tests.csproj /p:Configuration=Release
if($LASTEXITCODE -ne 0) { exit 2 }
& ..\..\packages\xunit.runner.console.2.2.0-beta1-build3239\tools\xunit.console.x86.exe ..\..\test\MessageTemplates.Net40Tests\bin\Release\MessageTemplates.Net40Tests.dll
if($LASTEXITCODE -ne 0) { exit 2 }
Pop-Location
Push-Location
&nuget install test\MessageTemplates.Net35Tests\packages.config -SolutionDirectory .
&msbuild test\MessageTemplates.Net35Tests\MessageTemplates.Net35Tests.csproj /p:Configuration=Release
if($LASTEXITCODE -ne 0) { exit 2 }
& packages\xunit.runner.console.2.2.0-beta1-build3239\tools\xunit.console.x86.exe test\MessageTemplates.Net35Tests\bin\Release\MessageTemplates.Net35Tests.dll
if($LASTEXITCODE -ne 0) { exit 2 }
Pop-Location