Skip to content

Commit 7832268

Browse files
committed
Update build scripts and clean up README
1 parent 68849ec commit 7832268

File tree

6 files changed

+69
-19
lines changed

6 files changed

+69
-19
lines changed

Build.ps1

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
1+
echo "build: Build started"
2+
13
Push-Location $PSScriptRoot
24

3-
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
5+
if(Test-Path .\artifacts) {
6+
echo "build: Cleaning .\artifacts"
7+
Remove-Item .\artifacts -Force -Recurse
8+
}
49

5-
& dotnet restore
10+
& dotnet restore --no-cache
611

7-
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
12+
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
13+
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
14+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
815

9-
Push-Location src/Serilog.Sinks.Observable
16+
echo "build: Version suffix is $suffix"
1017

11-
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$revision
12-
if($LASTEXITCODE -ne 0) { exit 1 }
18+
foreach ($src in ls src/*) {
19+
Push-Location $src
1320

14-
Pop-Location
15-
Push-Location test/Serilog.Tests
21+
echo "build: Packaging project in $src"
1622

17-
& dotnet test -c Release
18-
if($LASTEXITCODE -ne 0) { exit 2 }
23+
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
24+
if($LASTEXITCODE -ne 0) { exit 1 }
1925

20-
Pop-Location
26+
Pop-Location
27+
}
28+
29+
foreach ($test in ls test/*.PerformanceTests) {
30+
Push-Location $test
31+
32+
echo "build: Building performance test project in $test"
33+
34+
& dotnet build -c Release
35+
if($LASTEXITCODE -ne 0) { exit 2 }
36+
37+
Pop-Location
38+
}
39+
40+
foreach ($test in ls test/*.Tests) {
41+
Push-Location $test
42+
43+
echo "build: Testing project in $test"
44+
45+
& dotnet test -c Release
46+
if($LASTEXITCODE -ne 0) { exit 3 }
47+
48+
Pop-Location
49+
}
2150

2251
Pop-Location

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
1-
#The Observable sink for Serilog
1+
# Serilog.Sinks.Observable [![Build status](https://ci.appveyor.com/api/projects/status/adgctkfvda8or6rv?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-observable) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Observable.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Observable/)
22

3-
##NOTE: Work in progress as apart of the [Serilog 2.0 release](https://github.com/serilog/serilog/issues?q=is%3Aissue+is%3Aopen+label%3Av2).
3+
Write Serilog events to observers (Rx) through an `IObservable`.
44

5-
[![Build status](https://ci.appveyor.com/api/projects/status/adgctkfvda8or6rv?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-observable) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Observable.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Observable/)
5+
### Getting started
66

7-
* [Documentation](https://github.com/serilog/serilog/wiki)
7+
Install the package from NuGet:
8+
9+
```
10+
Install-Package Serilog.Sinks.Observable
11+
```
12+
13+
Configure Serilog using `WriteTo.Observers`:
14+
15+
```csharp
16+
Log.Logger = new LoggerConfiguration()
17+
.WriteTo.Observers(events => events
18+
.Do(evt => {
19+
Console.WriteLine($"Observed event {evt}");
20+
})
21+
.Subscribe())
22+
.CreateLogger();
23+
24+
Log.Infomation("Hello, observers!");
25+
26+
Log.CloseAndFlush();
27+
```
28+
29+
More information about using Serilog is available in the [Serilog Documentation](https://github.com/serilog/serilog/wiki).
830

931
Copyright © 2016 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html).

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ deploy:
2222
branch: /^(master|dev)$/
2323
- provider: GitHub
2424
auth_token:
25-
secure: ggZTqqV1z0xecDoQbeoy3A7xikShCt9FWZIGp95dG9Fo0p5RAT9oGU0ZekHfUIwk
25+
secure: p4LpVhBKxGS5WqucHxFQ5c7C8cP74kbNB0Z8k9Oxx/PMaDQ1+ibmoexNqVU5ZlmX
2626
artifact: /Serilog.*\.nupkg/
2727
tag: v$(appveyor_build_version)
2828
on:
File renamed without changes.

src/Serilog.Sinks.Observable/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"version": "2.0.0",
2+
"version": "2.0.1",
33
"packOptions": {
4-
"description": "The observable sink for Serilog.",
4+
"description": "Write Serilog events to observers (Rx) through an IObservable.",
55
"authors": [ "Serilog Contributors" ],
66
"tags": [ "serilog", "observable", "reactive" ],
77
"projectUrl": "http://serilog.net",

test/Serilog.Tests/project.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"version": "2.0.0",
32
"testRunner": "xunit",
43
"dependencies": {
54
"Rx-Main": "2.2.5",

0 commit comments

Comments
 (0)