Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit b28edea

Browse files
authored
Merge pull request #41 from influxdata/dev
Fix master build
2 parents 4b6788d + 1e82e26 commit b28edea

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

Build.ps1

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,61 @@
11
# Originally based on https://github.com/serilog/serilog/blob/dev/Build.ps1 - (c) Serilog Contributors
22

3-
echo "build: Build started"
4-
53
Push-Location $PSScriptRoot
64

7-
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
8-
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
9-
$suffix = @{
10-
$true = "$revision";
11-
$false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
12-
135
if(Test-Path .\artifacts) {
146
echo "build: Cleaning .\artifacts"
157
Remove-Item .\artifacts -Force -Recurse
168
}
179

18-
& dotnet msbuild "/t:Restore" /p:VersionSuffix=$suffix /p:Configuration=Release
10+
& dotnet restore --no-cache
1911

20-
echo "build: Version suffix is $suffix"
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 = "local" }[$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 "local"]
15+
$commitHash = $(git rev-parse --short HEAD)
16+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
17+
18+
echo "build: Package version suffix is $suffix"
19+
echo "build: Build version suffix is $buildSuffix"
2120

2221
foreach ($src in ls src/*) {
23-
Push-Location $src
22+
Push-Location $src
2423

2524
echo "build: Packaging project in $src"
2625

27-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
28-
if($LASTEXITCODE -ne 0) { exit 1 }
26+
& dotnet build -c Release --version-suffix=$buildSuffix
27+
28+
if ($suffix) {
29+
& dotnet pack -c Release --include-source -o ..\..\artifacts --version-suffix=$suffix --no-build
30+
} else {
31+
& dotnet pack -c Release --include-source -o ..\..\artifacts --no-build
32+
}
33+
34+
if($LASTEXITCODE -ne 0) { exit 1 }
2935

30-
Pop-Location
36+
Pop-Location
3137
}
3238

33-
foreach ($test in ls test/*.PerformanceTests) {
34-
Push-Location $test
39+
foreach ($test in ls test/*.Tests) {
40+
Push-Location $test
3541

36-
echo "build: Building performance test project in $test"
42+
echo "build: Testing project in $test"
3743

38-
& dotnet build -c Release
39-
if($LASTEXITCODE -ne 0) { exit 2 }
44+
& dotnet test -c Release
45+
if($LASTEXITCODE -ne 0) { exit 3 }
4046

41-
Pop-Location
47+
Pop-Location
4248
}
4349

44-
foreach ($test in ls test/*.Tests) {
45-
Push-Location $test
50+
foreach ($test in ls test/*.PerformanceTests) {
51+
Push-Location $test
4652

47-
echo "build: Testing project in $test"
53+
echo "build: Building performance test project in $test"
4854

49-
& dotnet test -c Release
50-
if($LASTEXITCODE -ne 0) { exit 3 }
55+
& dotnet build -c Release
56+
if($LASTEXITCODE -ne 0) { exit 2 }
5157

52-
Pop-Location
58+
Pop-Location
5359
}
5460

5561
Pop-Location

src/InfluxDB.LineProtocol/InfluxDB.LineProtocol.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>A .NET library for efficiently sending time series to InfluxDB</Description>

0 commit comments

Comments
 (0)