Skip to content

Commit a4a7db9

Browse files
authored
Merge pull request #48 from merbla/vs2017-tooling
Vs2017 tooling
2 parents 831860c + 9543441 commit a4a7db9

16 files changed

+173
-249
lines changed

.travis.yml

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,11 @@
11
language: csharp
22

3-
#dotnet cli require Ubuntu 14.04
4-
sudo: required
5-
dist: trusty
6-
7-
#dotnet cli require OSX 10.10
8-
osx_image: xcode7.1
9-
10-
addons:
11-
apt:
12-
packages:
13-
- gettext
14-
- libcurl4-openssl-dev
15-
- libicu-dev
16-
- libssl-dev
17-
- libunwind8
18-
- zlib1g
19-
20-
os:
21-
#- osx
22-
- linux
23-
24-
env:
25-
matrix:
26-
- CLI_VERSION=1.0.0-preview2-003121
27-
# - CLI_VERSION=Latest
28-
293
matrix:
30-
allow_failures:
31-
- env: CLI_VERSION=Latest
32-
33-
before_install:
34-
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi
35-
# Download script to install dotnet cli
36-
- if test "$CLI_OBTAIN_URL" == ""; then export CLI_OBTAIN_URL="https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.sh"; fi
37-
- curl -L --create-dirs $CLI_OBTAIN_URL -o ./scripts/obtain/install.sh
38-
- find ./scripts -name "*.sh" -exec chmod +x {} \;
39-
- export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"
40-
# use bash to workaround bug https://github.com/dotnet/cli/issues/1725
41-
- sudo bash ./scripts/obtain/install.sh --channel "preview" --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR" --no-path
42-
# add dotnet to PATH
43-
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
4+
include:
5+
- os: linux # Ubuntu 14.04
6+
dist: trusty
7+
sudo: required
8+
dotnet: 1.0.4
449

4510
script:
4611
- ./build.sh

Build.ps1

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,42 @@ if(Test-Path .\artifacts) {
1212
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
1313
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
1414
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
15+
$commitHash = $(git rev-parse --short HEAD)
16+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1517

16-
echo "build: Version suffix is $suffix"
18+
echo "build: Package version suffix is $suffix"
19+
echo "build: Build version suffix is $buildSuffix"
1720

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

2124
echo "build: Packaging project in $src"
2225

23-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
26+
& dotnet build -c Release --version-suffix=$buildSuffix
27+
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --version-suffix=$suffix --no-build
2428
if($LASTEXITCODE -ne 0) { exit 1 }
2529

2630
Pop-Location
2731
}
2832

29-
foreach ($test in ls test/*.PerformanceTests) {
33+
foreach ($test in ls test/*.Tests) {
3034
Push-Location $test
3135

32-
echo "build: Building performance test project in $test"
36+
echo "build: Testing project in $test"
3337

34-
& dotnet build -c Release
35-
if($LASTEXITCODE -ne 0) { exit 2 }
38+
& dotnet test -c Release
39+
if($LASTEXITCODE -ne 0) { exit 3 }
3640

3741
Pop-Location
3842
}
3943

40-
foreach ($test in ls test/*.Tests) {
44+
foreach ($test in ls sample/Sample) {
4145
Push-Location $test
4246

43-
echo "build: Testing project in $test"
47+
echo "build: Building performance test project in $test"
4448

45-
& dotnet test -c Release
46-
if($LASTEXITCODE -ne 0) { exit 3 }
49+
& dotnet build -c Release
50+
if($LASTEXITCODE -ne 0) { exit 2 }
4751

4852
Pop-Location
4953
}

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
##2.2.0
2+
- [#47] Tooling updates to VS2017
3+
14
##2.1.2
25
- [#43](https://github.com/serilog/serilog-sinks-splunk/pull/43) - Extend sink & static configuration to allow for custom JSON formatter.
36

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ image: Visual Studio 2015
44
configuration: Release
55
install:
66
- ps: mkdir -Force ".\build\" | Out-Null
7-
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
7+
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
88
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
9-
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.0-preview2-003121'
9+
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.1'
1010
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
1111
build_script:
1212
- ps: ./Build.ps1
@@ -26,4 +26,4 @@ deploy:
2626
artifact: /Serilog.*\.nupkg/
2727
tag: v$(appveyor_build_version)
2828
on:
29-
branch: master
29+
branch: master

build.sh

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
#!/bin/bash
22

3-
# Ensure any exit code exits TravisCI
4-
set -e
3+
set -e
54

5+
export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"
6+
DotnetCliVersion=${CLI_VERSION:="1.0.1"}
7+
install_script_url=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh
8+
curl -sSL $install_script_url | bash /dev/stdin --version "$DotnetCliVersion" --install-dir "$DOTNET_INSTALL_DIR"
9+
export PATH="$DOTNET_INSTALL_DIR:$PATH"
10+
11+
# See issue https://github.com/NuGet/Home/issues/2163
12+
ulimit -n 2048
13+
14+
dotnet --info
615
dotnet restore
7-
for path in src/*/project.json; do
8-
dirname="$(dirname "${path}")"
9-
dotnet build ${dirname}
10-
done
1116

12-
for path in sample/project.json; do
13-
dirname="$(dirname "${path}")"
14-
dotnet build ${dirname}
15-
done
17+
for path in src/**/*.csproj; do
18+
dotnet build -f netstandard1.1 -c Release ${path}
19+
done
20+
21+
for path in test/*.Tests/*.csproj; do
22+
dotnet test -f netcoreapp1.0 -c Release ${path}
23+
done
1624

17-
for path in test/Serilog.Sinks.Splunk.Tests/project.json; do
18-
dirname="$(dirname "${path}")"
19-
dotnet build ${dirname} -f netcoreapp1.0 -c Release
20-
dotnet test ${dirname} -f netcoreapp1.0 -c Release
21-
done
25+
dotnet build -f netcoreapp1.0 -c Release sample/Sample/Sample.csproj

global.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

sample/Program.cs renamed to sample/Sample/Program.cs

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
using System.Linq;
2-
using System.Threading;
32
using Serilog;
4-
using Serilog.Core;
53

64
namespace Sample
75
{
8-
///
9-
/// Sample 10 false
10-
///
116
public class Program
127
{
138
public static string EventCollectorToken = "2B94855F-1184-46F7-BFF1-56A3112F627E";
14-
9+
1510
public static void Main(string[] args)
1611
{
1712
var eventsToCreate = 100;
1813
var runSSL = false;
19-
20-
if(args.Length > 0)
21-
eventsToCreate = int.Parse(args[0]);
22-
23-
if(args.Length == 2)
24-
runSSL = bool.Parse(args[1]);
14+
15+
if (args.Length > 0)
16+
eventsToCreate = int.Parse(args[0]);
17+
18+
if (args.Length == 2)
19+
runSSL = bool.Parse(args[1]);
2520

2621
Log.Information("Sample starting up");
2722
Serilog.Debugging.SelfLog.Enable(System.Console.Out);
@@ -33,9 +28,9 @@ public static void Main(string[] args)
3328
OverridingHost(eventsToCreate);
3429
WithNoTemplate(eventsToCreate);
3530

36-
if(runSSL)
31+
if (runSSL)
3732
UsingSSL(eventsToCreate);
38-
33+
3934
Log.Debug("Done");
4035
}
4136

@@ -44,15 +39,15 @@ public static void OverridingSource(int eventsToCreate)
4439
// Override Source
4540
Log.Logger = new LoggerConfiguration()
4641
.MinimumLevel.Debug()
47-
.WriteTo.LiterateConsole()
42+
.WriteTo.LiterateConsole()
4843
.WriteTo.EventCollector(
49-
"http://localhost:8088",
44+
"http://localhost:8088",
5045
Program.EventCollectorToken,
5146
source: "Serilog.Sinks.Splunk.Sample.TestSource")
5247
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
5348
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Source Override")
5449
.CreateLogger();
55-
50+
5651
foreach (var i in Enumerable.Range(0, eventsToCreate))
5752
{
5853
Log.Information("Running source override loop {Counter}", i);
@@ -67,15 +62,15 @@ public static void OverridingSourceType(int eventsToCreate)
6762
// Override Source
6863
Log.Logger = new LoggerConfiguration()
6964
.MinimumLevel.Debug()
70-
.WriteTo.LiterateConsole()
65+
.WriteTo.LiterateConsole()
7166
.WriteTo.EventCollector(
72-
"http://localhost:8088",
67+
"http://localhost:8088",
7368
Program.EventCollectorToken,
7469
sourceType: "Serilog.Sinks.Splunk.Sample.TestSourceType")
7570
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
7671
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Source Type Override")
7772
.CreateLogger();
78-
73+
7974
foreach (var i in Enumerable.Range(0, eventsToCreate))
8075
{
8176
Log.Information("Running source type override loop {Counter}", i);
@@ -90,15 +85,15 @@ public static void OverridingHost(int eventsToCreate)
9085
// Override Host
9186
Log.Logger = new LoggerConfiguration()
9287
.MinimumLevel.Debug()
93-
.WriteTo.LiterateConsole()
88+
.WriteTo.LiterateConsole()
9489
.WriteTo.EventCollector(
95-
"http://localhost:8088",
90+
"http://localhost:8088",
9691
Program.EventCollectorToken,
9792
host: "myamazingmachine")
9893
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
9994
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Host Override")
10095
.CreateLogger();
101-
96+
10297
foreach (var i in Enumerable.Range(0, eventsToCreate))
10398
{
10499
Log.Information("Running host override loop {Counter}", i);
@@ -113,7 +108,7 @@ public static void UsingFullUri(int eventsToCreate)
113108
// Vanilla Test with full uri specified
114109
Log.Logger = new LoggerConfiguration()
115110
.MinimumLevel.Debug()
116-
.WriteTo.LiterateConsole()
111+
.WriteTo.LiterateConsole()
117112
.WriteTo.EventCollector(
118113
"http://localhost:8088/services/collector",
119114
Program.EventCollectorToken)
@@ -135,13 +130,13 @@ public static void UsingHostOnly(int eventsToCreate)
135130
// Vanilla Tests just host
136131
Log.Logger = new LoggerConfiguration()
137132
.MinimumLevel.Debug()
138-
.WriteTo.LiterateConsole()
133+
.WriteTo.LiterateConsole()
139134
.WriteTo.EventCollector(
140135
"http://localhost:8088",
141136
Program.EventCollectorToken)
142137
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
143138
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Vanilla No services/collector in uri")
144-
.CreateLogger();
139+
.CreateLogger();
145140

146141
foreach (var i in Enumerable.Range(0, eventsToCreate))
147142
{
@@ -156,15 +151,15 @@ public static void WithNoTemplate(int eventsToCreate)
156151
// No Template
157152
Log.Logger = new LoggerConfiguration()
158153
.MinimumLevel.Debug()
159-
.WriteTo.LiterateConsole()
154+
.WriteTo.LiterateConsole()
160155
.WriteTo.EventCollector(
161-
"http://localhost:8088",
156+
"http://localhost:8088",
162157
Program.EventCollectorToken,
163158
renderTemplate: false)
164159
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
165160
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "No Templates")
166161
.CreateLogger();
167-
162+
168163
foreach (var i in Enumerable.Range(0, eventsToCreate))
169164
{
170165
Log.Information("Running no template loop {Counter}", i);
@@ -178,14 +173,14 @@ public static void UsingSSL(int eventsToCreate)
178173
// SSL
179174
Log.Logger = new LoggerConfiguration()
180175
.MinimumLevel.Debug()
181-
.WriteTo.LiterateConsole()
176+
.WriteTo.LiterateConsole()
182177
.WriteTo.EventCollector(
183178
"https://localhost:8088",
184179
Program.EventCollectorToken)
185180
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
186181
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "HTTPS")
187-
.CreateLogger();
188-
182+
.CreateLogger();
183+
189184
foreach (var i in Enumerable.Range(0, eventsToCreate))
190185
{
191186
Log.Information("HTTPS {Counter}", i);

sample/Sample/Sample.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp1.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Serilog" Version="2.4.0" />
10+
<PackageReference Include="Serilog.Sinks.Literate" Version="2.1.0" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\..\src\Serilog.Sinks.Splunk\Serilog.Sinks.Splunk.csproj" />
15+
</ItemGroup>
16+
17+
</Project>

sample/project.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)