Skip to content

Commit

Permalink
Merge pull request #40 from serilog/dev
Browse files Browse the repository at this point in the history
Release 2.3
  • Loading branch information
nblumhardt authored Jul 28, 2017
2 parents 26be724 + cb475b7 commit 2df3a9f
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 164 deletions.
36 changes: 10 additions & 26 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,22 @@ $revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUI
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]

echo "build: Version suffix is $suffix"

foreach ($src in ls src/*) {
Push-Location $src

echo "build: Packaging project in $src"

& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
if($LASTEXITCODE -ne 0) { exit 1 }

Pop-Location
}
Push-Location $src
echo "build: Packaging project in $src"

foreach ($test in ls test/*.PerformanceTests) {
Push-Location $test
& dotnet pack -c Release -o ..\..\artifacts --include-symbols --version-suffix=$suffix
if($LASTEXITCODE -ne 0) { exit 1 }

echo "build: Building performance test project in $test"

& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }

Pop-Location
Pop-Location
}

foreach ($test in ls test/*.Tests) {
Push-Location $test

echo "build: Testing project in $test"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }

Pop-Location
Push-Location $test
echo "build: Testing project in $test"
& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }
Pop-Location
}

Pop-Location
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.2.2
* allow disabling SMTP SSL certification validation

2.0
* enabled netstandard1.3 support using MailKit

1.5
* Moved from serilog/serilog

Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: '{build}'
skip_tags: true
image: Visual Studio 2015
image: Visual Studio 2017
configuration: Release
install:
- ps: mkdir -Force ".\build\" | Out-Null
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.0-preview2-003121'
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.1'
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
build_script:
- ps: ./Build.ps1
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003121"
"version": "1.0.1"
}
}
40 changes: 30 additions & 10 deletions serilog-sinks-email.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.Email", "src\Serilog.Sinks.Email\Serilog.Sinks.Email.xproj", "{37082D9A-C3C9-490E-8AB9-FED496F5A70B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{DACEA959-EA30-47CA-A300-6756E3EB35A4}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
Expand All @@ -20,28 +18,50 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{340DBC35-BD0
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{70D17E86-9325-4228-8512-547B3E0774A1}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.Email.Tests", "test\Serilog.Sinks.Email.Tests\Serilog.Sinks.Email.Tests.xproj", "{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Email.Tests", "test\Serilog.Sinks.Email.Tests\Serilog.Sinks.Email.Tests.csproj", "{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Email", "src\Serilog.Sinks.Email\Serilog.Sinks.Email.csproj", "{96A53337-1692-4884-BE03-34A97147EACE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{37082D9A-C3C9-490E-8AB9-FED496F5A70B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37082D9A-C3C9-490E-8AB9-FED496F5A70B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37082D9A-C3C9-490E-8AB9-FED496F5A70B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37082D9A-C3C9-490E-8AB9-FED496F5A70B}.Release|Any CPU.Build.0 = Release|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Debug|x64.ActiveCfg = Debug|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Debug|x64.Build.0 = Debug|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Debug|x86.ActiveCfg = Debug|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Debug|x86.Build.0 = Debug|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Release|Any CPU.Build.0 = Release|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Release|x64.ActiveCfg = Release|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Release|x64.Build.0 = Release|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Release|x86.ActiveCfg = Release|Any CPU
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97}.Release|x86.Build.0 = Release|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Debug|x64.ActiveCfg = Debug|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Debug|x64.Build.0 = Debug|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Debug|x86.ActiveCfg = Debug|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Debug|x86.Build.0 = Debug|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Release|Any CPU.Build.0 = Release|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Release|x64.ActiveCfg = Release|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Release|x64.Build.0 = Release|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Release|x86.ActiveCfg = Release|Any CPU
{96A53337-1692-4884-BE03-34A97147EACE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{37082D9A-C3C9-490E-8AB9-FED496F5A70B} = {340DBC35-BD09-414B-818C-978FBCA4CDF1}
{7BC4F72D-F40B-4F7C-8EBD-E50F0D6C0D97} = {70D17E86-9325-4228-8512-547B3E0774A1}
{96A53337-1692-4884-BE03-34A97147EACE} = {340DBC35-BD09-414B-818C-978FBCA4CDF1}
EndGlobalSection
EndGlobal
50 changes: 50 additions & 0 deletions src/Serilog.Sinks.Email/Serilog.Sinks.Email.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>The file sink for Serilog</Description>
<VersionPrefix>2.3.0</VersionPrefix>
<Authors>Serilog Contributors</Authors>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Serilog.Sinks.Email</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>Serilog.Sinks.Email</PackageId>
<PackageTags>serilog;file;io</PackageTags>
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
<PackageProjectUrl>http://serilog.net</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<!-- Don't reference the full NETStandard.Library -->
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System.Net" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<DefineConstants>$(DefineConstants);SYSTEM_NET</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);MAIL_KIT</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="MailKit" Version="1.4.2" />
<PackageReference Include="System.Linq" Version="4.1.0" />
<PackageReference Include="System.Threading" Version="4.0.11" />
</ItemGroup>

</Project>
19 changes: 0 additions & 19 deletions src/Serilog.Sinks.Email/Serilog.Sinks.Email.xproj

This file was deleted.

11 changes: 11 additions & 0 deletions src/Serilog.Sinks.Email/Sinks/Email/EmailConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ public EmailConnectionInfo()
/// </summary>
public bool EnableSsl { get; set; }

/// <summary>
/// Provides a method that validates server certificates.
/// </summary>
/// <remarks>
/// This only works on `netstandard1.3` with `MailKit`. If you
/// are targeting `net45`+, you should add your validation to
/// `System.Net.ServicePointManager.ServerCertificateValidationCallback`
/// manually.
/// </remarks>
public System.Net.Security.RemoteCertificateValidationCallback ServerCertificateValidationCallback { get; set; }

/// <summary>
/// The SMTP email server to use.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Serilog.Sinks.Email/Sinks/Email/MailKitEmailSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ private SmtpClient OpenConnectedSmtpClient()
var smtpClient = new SmtpClient();
if (!string.IsNullOrWhiteSpace(_connectionInfo.MailServer))
{
if (_connectionInfo.ServerCertificateValidationCallback != null)
{
smtpClient.ServerCertificateValidationCallback += _connectionInfo.ServerCertificateValidationCallback;
}

smtpClient.Connect(
_connectionInfo.MailServer, _connectionInfo.Port,
useSsl: _connectionInfo.EnableSsl);
Expand Down
41 changes: 0 additions & 41 deletions src/Serilog.Sinks.Email/project.json

This file was deleted.

50 changes: 50 additions & 0 deletions test/Serilog.Sinks.Email.Tests/Serilog.Sinks.Email.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.0.0</VersionPrefix>
<TargetFrameworks>net452;netcoreapp1.0</TargetFrameworks>
<AssemblyName>Serilog.Sinks.Email.Tests</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>Serilog.Sinks.Email.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.3</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Email\Serilog.Sinks.Email.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="Serilog" Version="2.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System.Configuration" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net452' ">
<DefineConstants>$(DefineConstants);SYSTEM_NET</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<DefineConstants>$(DefineConstants);MAIL_KIT</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<PackageReference Include="System.Linq" Version="4.1.0" />
<PackageReference Include="System.Threading" Version="4.0.11" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
21 changes: 0 additions & 21 deletions test/Serilog.Sinks.Email.Tests/Serilog.Sinks.Email.Tests.xproj

This file was deleted.

Loading

0 comments on commit 2df3a9f

Please sign in to comment.