Skip to content

Commit 58f88ff

Browse files
committed
Build infrastructure; lacking Xamarin tools to set up .sln file properly
1 parent 03a437d commit 58f88ff

File tree

5 files changed

+102
-0
lines changed

5 files changed

+102
-0
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-xamarin.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
Global
7+
GlobalSection(SolutionProperties) = preSolution
8+
HideSolutionNode = FALSE
9+
EndGlobalSection
10+
EndGlobal

0 commit comments

Comments
 (0)