Skip to content

Commit b4da2db

Browse files
committed
Use updated Build.ps1 from serilog/serilog repo,
and add artifacts to solution
1 parent 2723df8 commit b4da2db

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed

Build.ps1

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,51 @@
1+
echo "build: Build started"
2+
13
Push-Location $PSScriptRoot
24

3-
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
5+
if(Test-Path .\artifacts) {
6+
echo "build: Cleaning .\artifacts"
7+
Remove-Item .\artifacts -Force -Recurse
8+
}
49

510
& dotnet restore --no-cache
611

7-
$branch = $(git symbolic-ref --short -q HEAD)
8-
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
9-
$suffix = @{ $true = ""; $false = "$branch-$revision"}[$branch -eq "master" -and $revision -ne "local"]
12+
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
13+
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "l" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
14+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "l"]
1015

11-
foreach ($src in ls src/Serilog.*) {
16+
echo "build: Version suffix is $suffix"
17+
18+
foreach ($src in ls src/*) {
1219
Push-Location $src
1320

14-
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$suffix
15-
if($LASTEXITCODE -ne 0) { exit 1 }
21+
echo "build: Packaging project in $src"
22+
23+
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
24+
if($LASTEXITCODE -ne 0) { exit 1 }
1625

1726
Pop-Location
1827
}
1928

20-
foreach ($test in ls test/Serilog.*.Tests) {
29+
foreach ($test in ls test/*.PerformanceTests) {
2130
Push-Location $test
2231

23-
& dotnet test -c Release
32+
echo "build: Building performance test project in $test"
33+
34+
& dotnet build -c Release
2435
if($LASTEXITCODE -ne 0) { exit 2 }
2536

2637
Pop-Location
2738
}
2839

40+
foreach ($test in ls test/*.Tests) {
41+
Push-Location $test
42+
43+
echo "build: Testing project in $test"
44+
45+
& dotnet test -c Release
46+
if($LASTEXITCODE -ne 0) { exit 3 }
47+
48+
Pop-Location
49+
}
50+
2951
Pop-Location

serilog-sinks-azuretablestorage.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.AzureTableSto
77
EndProject
88
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.AzureTableStorageWithProperties.Tests", "test\Serilog.Sinks.AzureTableStorageWithProperties.Tests\Serilog.Sinks.AzureTableStorageWithProperties.Tests.xproj", "{2740763E-959A-4AAD-BFC9-5B428393DFDE}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Artifacts", "Artifacts", "{40D1EC3F-DCD9-47EB-8629-54D71AC31757}"
11+
ProjectSection(SolutionItems) = preProject
12+
appveyor.yml = appveyor.yml
13+
Build.ps1 = Build.ps1
14+
CHANGES.md = CHANGES.md
15+
global.json = global.json
16+
README.md = README.md
17+
EndProjectSection
18+
EndProject
1019
Global
1120
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1221
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)