Skip to content

Commit 110969f

Browse files
committed
Merge pull request #21 from jansoren/dev
Reinstated the PowerShell-based versioning
2 parents 44fddd8 + 41851b3 commit 110969f

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

Build.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ param(
66
[String] $sln # e.g serilog-sink-name
77
)
88

9+
function Set-AssemblyVersions($informational, $assembly)
10+
{
11+
(Get-Content assets/CommonAssemblyInfo.cs) |
12+
ForEach-Object { $_ -replace """1.0.0.0""", """$assembly""" } |
13+
ForEach-Object { $_ -replace """1.0.0""", """$informational""" } |
14+
ForEach-Object { $_ -replace """1.1.1.1""", """$($informational).0""" } |
15+
Set-Content assets/CommonAssemblyInfo.cs
16+
}
17+
918
function Install-NuGetPackages($solution)
1019
{
1120
nuget restore $solution
@@ -47,6 +56,14 @@ function Invoke-Build($majorMinor, $patch, $customLogger, $notouch, $sln)
4756

4857
Write-Output "$sln $package"
4958

59+
if (-not $notouch)
60+
{
61+
$assembly = "$majorMinor.0.0"
62+
63+
Write-Output "Assembly version will be set to $assembly"
64+
Set-AssemblyVersions $package $assembly
65+
}
66+
5067
Install-NuGetPackages $slnfile
5168

5269
Invoke-MSBuild $slnfile $customLogger

assets/CommonAssemblyInfo.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using System.Reflection;
2+
3+
[assembly: AssemblyVersion("1.0.0.0")]
4+
[assembly: AssemblyFileVersion("1.1.1.1")]
5+
[assembly: AssemblyInformationalVersion("1.0.0")]

src/Serilog.Sinks.MSSqlServer/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
[assembly: AssemblyTitle("Serilog.Sinks.MSSqlServer")]
55
[assembly: AssemblyDescription("Serilog sink for MSSqlServer")]
66
[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2014")]
7-
[assembly: AssemblyVersion("1.0.0.0")]
8-
[assembly: AssemblyFileVersion("1.0.0.0")]
9-
[assembly: AssemblyInformationalVersion("1.0.0")]
107

118
[assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" +
129
"6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" +

src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
<Compile Include="Configuration\MSSqlServerConfigurationSection.cs" />
7070
<Compile Include="LoggerConfigurationMSSqlServerExtensions.cs" />
7171
<Compile Include="Properties\AssemblyInfo.cs" />
72+
<Compile Include="..\..\assets\CommonAssemblyInfo.cs">
73+
<Link>Properties\CommonAssemblyInfo.cs</Link>
74+
</Compile>
7275
<Compile Include="Sinks\MSSqlServer\ColumnOptions.cs" />
7376
<Compile Include="Sinks\MSSqlServer\MSSqlServerSink.cs" />
7477
<Compile Include="Sinks\MSSqlServer\SqlTableCreator.cs" />

0 commit comments

Comments
 (0)