Skip to content
This repository was archived by the owner on Feb 27, 2022. It is now read-only.

Commit aab6062

Browse files
committed
Build infrastructure
1 parent 89514dd commit aab6062

File tree

7 files changed

+121
-4
lines changed

7 files changed

+121
-4
lines changed

Build.ps1

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
param(
2+
[String] $majorMinor = "0.0", # 2.0
3+
[String] $patch = "0", # $env:APPVEYOR_BUILD_VERSION
4+
[String] $customLogger = "", # C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll
5+
[Switch] $notouch,
6+
[String] $sln # e.g serilog-sink-name
7+
)
8+
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+
18+
function Install-NuGetPackages($solution)
19+
{
20+
nuget restore $solution
21+
}
22+
23+
function Invoke-MSBuild($solution, $customLogger)
24+
{
25+
if ($customLogger)
26+
{
27+
msbuild "$solution" /verbosity:minimal /p:Configuration=Release /logger:"$customLogger"
28+
}
29+
else
30+
{
31+
msbuild "$solution" /verbosity:minimal /p:Configuration=Release
32+
}
33+
}
34+
35+
function Invoke-NuGetPackProj($csproj)
36+
{
37+
nuget pack -Prop Configuration=Release -Symbols $csproj
38+
}
39+
40+
function Invoke-NuGetPackSpec($nuspec, $version)
41+
{
42+
nuget pack $nuspec -Version $version -OutputDirectory ..\..\
43+
}
44+
45+
function Invoke-NuGetPack($version)
46+
{
47+
ls src/**/*.csproj |
48+
Where-Object { -not ($_.Name -like "*net40*") } |
49+
ForEach-Object { Invoke-NuGetPackProj $_ }
50+
}
51+
52+
function Invoke-Build($majorMinor, $patch, $customLogger, $notouch, $sln)
53+
{
54+
$package="$majorMinor.$patch"
55+
$slnfile = "$sln.sln"
56+
57+
Write-Output "$sln $package"
58+
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+
67+
Install-NuGetPackages $slnfile
68+
69+
Invoke-MSBuild $slnfile $customLogger
70+
71+
Invoke-NuGetPack $package
72+
}
73+
74+
$ErrorActionPreference = "Stop"
75+
76+
if (-not $sln)
77+
{
78+
$slnfull = ls *.sln |
79+
Where-Object { -not ($_.Name -like "*net40*") } |
80+
Select -first 1
81+
82+
$sln = $slnfull.BaseName
83+
}
84+
85+
Invoke-Build $majorMinor $patch $customLogger $notouch $sln

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1.5
2+
* Moved from serilog/serilog

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")]

assets/Serilog.snk

596 Bytes
Binary file not shown.

serilog-sinks-nlog.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.31101.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.NLog", "src\Serilog.Sinks.NLog\Serilog.Sinks.NLog.csproj", "{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

src/Serilog.Sinks.NLog/Serilog.Sinks.NLog.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@
4343
<Reference Include="NLog">
4444
<HintPath>..\..\packages\NLog.3.0.0.0\lib\net45\NLog.dll</HintPath>
4545
</Reference>
46-
<Reference Include="Serilog">
47-
<HintPath>..\..\packages\Serilog.1.3.25\lib\net45\Serilog.dll</HintPath>
46+
<Reference Include="Serilog, Version=1.4.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
47+
<SpecificVersion>False</SpecificVersion>
48+
<HintPath>..\..\packages\Serilog.1.4.204\lib\net45\Serilog.dll</HintPath>
4849
</Reference>
49-
<Reference Include="Serilog.FullNetFx">
50-
<HintPath>..\..\packages\Serilog.1.3.25\lib\net45\Serilog.FullNetFx.dll</HintPath>
50+
<Reference Include="Serilog.FullNetFx, Version=1.4.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
51+
<SpecificVersion>False</SpecificVersion>
52+
<HintPath>..\..\packages\Serilog.1.4.204\lib\net45\Serilog.FullNetFx.dll</HintPath>
5153
</Reference>
5254
<Reference Include="System" />
5355
<Reference Include="System.Core" />

src/Serilog.Sinks.NLog/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<packages>
33
<package id="NLog" version="3.0.0.0" targetFramework="net45" />
44
<package id="Serilog" version="1.3.25" targetFramework="net45" />
5+
<package id="Serilog" version="1.4.204" targetFramework="net45" />
56
</packages>
67

0 commit comments

Comments
 (0)