Skip to content

Commit d343546

Browse files
authored
Merge pull request #324 from nblumhardt/linux-build-woes
Fix Linux build woes
2 parents 536b072 + 42285c4 commit d343546

File tree

2 files changed

+30
-39
lines changed

2 files changed

+30
-39
lines changed

Build.ps1

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,59 @@ echo "build: Build started"
22

33
Push-Location $PSScriptRoot
44

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

1010
& dotnet restore --no-cache
1111

1212
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
1313
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
1414
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "main" -and $revision -ne "local"]
15+
$commitHash = $(git rev-parse --short HEAD)
16+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1517

16-
echo "build: Version suffix is $suffix"
18+
echo "build: Package version suffix is $suffix"
19+
echo "build: Build version suffix is $buildSuffix"
1720

18-
foreach ($src in dir src/*) {
21+
foreach ($src in gci src/*) {
1922
Push-Location $src
2023

21-
echo "build: Packaging project in $src"
24+
echo "build: Packaging project in $src"
2225

23-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix -p:ContinuousIntegrationBuild=true
24-
if ($LASTEXITCODE -ne 0) { exit 1 }
26+
& dotnet build -c Release --version-suffix=$buildSuffix
2527

26-
Pop-Location
27-
}
28-
29-
foreach ($test in dir test/*.PerformanceTests) {
30-
Push-Location $test
31-
32-
echo "build: Building performance test project in $test"
33-
34-
& dotnet build -c Release
35-
if ($LASTEXITCODE -ne 0) { exit 2 }
28+
if($suffix) {
29+
& dotnet pack -c Release --include-source --no-build -o ../../artifacts --version-suffix=$suffix -p:ContinuousIntegrationBuild=true
30+
} else {
31+
& dotnet pack -c Release --include-source --no-build -o ../../artifacts -p:ContinuousIntegrationBuild=true
32+
}
33+
if($LASTEXITCODE -ne 0) { exit 1 }
3634

3735
Pop-Location
3836
}
3937

40-
foreach ($test in dir test/*.Tests) {
38+
foreach ($test in gci test/*.Tests) {
4139
Push-Location $test
4240

43-
echo "build: Testing project in $test"
41+
echo "build: Testing project in $test"
4442

45-
if ($PSVersionTable.Platform -eq "Unix") {
46-
& dotnet test -c Release -f netcoreapp3.1
47-
& dotnet test -c Release -f net6.0
48-
} else {
49-
& dotnet test -c Release
50-
}
51-
52-
if ($LASTEXITCODE -ne 0) { exit 3 }
43+
& dotnet test -c Release
44+
if($LASTEXITCODE -ne 0) { exit 3 }
5345

5446
Pop-Location
5547
}
5648

57-
if ($PSVersionTable.Platform -eq "Unix") {
58-
Push-Location sample/Sample
49+
foreach ($test in gci test/*.PerformanceTests) {
50+
Push-Location $test
5951

60-
& dotnet run -f netcoreapp3.1 -c Release --run-once
61-
if ($LASTEXITCODE -ne 0) { exit 4 }
52+
echo "build: Building performance test project in $test"
6253

63-
& dotnet run -f net6.0 -c Release --run-once
64-
if ($LASTEXITCODE -ne 0) { exit 4 }
54+
& dotnet build -c Release
55+
if($LASTEXITCODE -ne 0) { exit 2 }
6556

6657
Pop-Location
6758
}
6859

69-
Pop-Location
60+
Pop-Location

test/Serilog.Settings.Configuration.Tests/DllScanningAssemblyFinderTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class DllScanningAssemblyFinderTests
1818
[Fact]
1919
public void ShouldProbeCurrentDirectory()
2020
{
21-
var assemblyNames = new DllScanningAssemblyFinder().FindAssembliesContainingName("testdummies");
21+
var assemblyNames = new DllScanningAssemblyFinder().FindAssembliesContainingName("TestDummies");
2222
Assert.Single(assemblyNames);
2323
}
2424

@@ -33,9 +33,9 @@ public void ShouldProbePrivateBinPath()
3333
DirectoryInfo GetOrCreateDirectory(string name)
3434
=> Directory.Exists(name) ? new DirectoryInfo(name) : Directory.CreateDirectory(name);
3535

36-
File.Copy("testdummies.dll", $"{BinDir1}/customSink1.dll", true);
37-
File.Copy("testdummies.dll", $"{BinDir2}/customSink2.dll", true);
38-
File.Copy("testdummies.dll", $"{BinDir3}/thirdpartydependency.dll", true);
36+
File.Copy("TestDummies.dll", $"{BinDir1}/customSink1.dll", true);
37+
File.Copy("TestDummies.dll", $"{BinDir2}/customSink2.dll", true);
38+
File.Copy("TestDummies.dll", $"{BinDir3}/thirdpartydependency.dll", true);
3939

4040
var ad = AppDomain.CreateDomain("serilog", null,
4141
new AppDomainSetup

0 commit comments

Comments
 (0)