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

Commit

Permalink
Build infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
nblumhardt committed Mar 27, 2015
1 parent 89514dd commit aab6062
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 4 deletions.
85 changes: 85 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
param(
[String] $majorMinor = "0.0", # 2.0
[String] $patch = "0", # $env:APPVEYOR_BUILD_VERSION
[String] $customLogger = "", # C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll
[Switch] $notouch,
[String] $sln # e.g serilog-sink-name
)

function Set-AssemblyVersions($informational, $assembly)
{
(Get-Content assets/CommonAssemblyInfo.cs) |
ForEach-Object { $_ -replace """1.0.0.0""", """$assembly""" } |
ForEach-Object { $_ -replace """1.0.0""", """$informational""" } |
ForEach-Object { $_ -replace """1.1.1.1""", """$($informational).0""" } |
Set-Content assets/CommonAssemblyInfo.cs
}

function Install-NuGetPackages($solution)
{
nuget restore $solution
}

function Invoke-MSBuild($solution, $customLogger)
{
if ($customLogger)
{
msbuild "$solution" /verbosity:minimal /p:Configuration=Release /logger:"$customLogger"
}
else
{
msbuild "$solution" /verbosity:minimal /p:Configuration=Release
}
}

function Invoke-NuGetPackProj($csproj)
{
nuget pack -Prop Configuration=Release -Symbols $csproj
}

function Invoke-NuGetPackSpec($nuspec, $version)
{
nuget pack $nuspec -Version $version -OutputDirectory ..\..\
}

function Invoke-NuGetPack($version)
{
ls src/**/*.csproj |
Where-Object { -not ($_.Name -like "*net40*") } |
ForEach-Object { Invoke-NuGetPackProj $_ }
}

function Invoke-Build($majorMinor, $patch, $customLogger, $notouch, $sln)
{
$package="$majorMinor.$patch"
$slnfile = "$sln.sln"

Write-Output "$sln $package"

if (-not $notouch)
{
$assembly = "$majorMinor.0.0"

Write-Output "Assembly version will be set to $assembly"
Set-AssemblyVersions $package $assembly
}

Install-NuGetPackages $slnfile

Invoke-MSBuild $slnfile $customLogger

Invoke-NuGetPack $package
}

$ErrorActionPreference = "Stop"

if (-not $sln)
{
$slnfull = ls *.sln |
Where-Object { -not ($_.Name -like "*net40*") } |
Select -first 1

$sln = $slnfull.BaseName
}

Invoke-Build $majorMinor $patch $customLogger $notouch $sln
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1.5
* Moved from serilog/serilog
5 changes: 5 additions & 0 deletions assets/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using System.Reflection;

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.1.1.1")]
[assembly: AssemblyInformationalVersion("1.0.0")]
Binary file added assets/Serilog.snk
Binary file not shown.
22 changes: 22 additions & 0 deletions serilog-sinks-nlog.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.NLog", "src\Serilog.Sinks.NLog\Serilog.Sinks.NLog.csproj", "{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
10 changes: 6 additions & 4 deletions src/Serilog.Sinks.NLog/Serilog.Sinks.NLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@
<Reference Include="NLog">
<HintPath>..\..\packages\NLog.3.0.0.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="Serilog">
<HintPath>..\..\packages\Serilog.1.3.25\lib\net45\Serilog.dll</HintPath>
<Reference Include="Serilog, Version=1.4.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Serilog.1.4.204\lib\net45\Serilog.dll</HintPath>
</Reference>
<Reference Include="Serilog.FullNetFx">
<HintPath>..\..\packages\Serilog.1.3.25\lib\net45\Serilog.FullNetFx.dll</HintPath>
<Reference Include="Serilog.FullNetFx, Version=1.4.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Serilog.1.4.204\lib\net45\Serilog.FullNetFx.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
1 change: 1 addition & 0 deletions src/Serilog.Sinks.NLog/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<packages>
<package id="NLog" version="3.0.0.0" targetFramework="net45" />
<package id="Serilog" version="1.3.25" targetFramework="net45" />
<package id="Serilog" version="1.4.204" targetFramework="net45" />
</packages>

0 comments on commit aab6062

Please sign in to comment.