diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d70d01d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: csharp - -matrix: - include: - - os: linux - dist: trusty - sudo: required - dotnet: 2.1.4 - group: edge -script: - - ./build.sh \ No newline at end of file diff --git a/Build.ps1 b/Build.ps1 index 776d04f..2a1435f 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -20,7 +20,7 @@ foreach ($src in dir src/*) { echo "build: Packaging project in $src" - & dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix + & dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix -p:ContinuousIntegrationBuild=true if ($LASTEXITCODE -ne 0) { exit 1 } Pop-Location @@ -42,10 +42,25 @@ foreach ($test in dir test/*.Tests) { echo "build: Testing project in $test" - & dotnet test -c Release + if ($PSVersionTable.Platform -eq "Unix") { + & dotnet test -c Release -f netcoreapp2.0 + & dotnet test -c Release -f netcoreapp3.1 + } else { + & dotnet test -c Release + } + if ($LASTEXITCODE -ne 0) { exit 3 } Pop-Location } +if ($PSVersionTable.Platform -eq "Unix") { + Push-Location sample/Sample + + & dotnet run -f netcoreapp2.0 -c Release --run-once + if ($LASTEXITCODE -ne 0) { exit 4 } + + Pop-Location +} + Pop-Location diff --git a/appveyor.yml b/appveyor.yml index e5be49e..873c8df 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,18 @@ version: '{build}' skip_tags: true -image: Visual Studio 2019 +image: + - Visual Studio 2019 + - Ubuntu1604 configuration: Release build_script: - ps: ./Build.ps1 +for: +- + matrix: + only: + - image: Ubuntu1604 + build_script: + - pwsh ./Build.ps1 test: off artifacts: - path: artifacts/Serilog.*.nupkg @@ -12,7 +21,6 @@ deploy: - provider: NuGet api_key: secure: b7jxRe5kR3kuxMrmdDuN0jvaaWWHwtFRnAwFZZV6MdaorwUhASR/Ey1gPn6vXwND - skip_symbols: true on: branch: /^(master|dev)$/ - provider: GitHub diff --git a/build.sh b/build.sh deleted file mode 100755 index 19ab21c..0000000 --- a/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e -dotnet --info -dotnet restore - -for path in src/**/*.csproj; do - dotnet build -f netstandard2.0 -c Release ${path} -done - -for path in test/*.Tests/*.csproj; do - dotnet test -f netcoreapp2.0 -c Release ${path} -done - -cd sample/Sample/ -dotnet build -f netcoreapp2.0 -c Release -dotnet bin/Release/netcoreapp2.0/Sample.dll --run-once diff --git a/src/Serilog.Settings.Configuration/Serilog.Settings.Configuration.csproj b/src/Serilog.Settings.Configuration/Serilog.Settings.Configuration.csproj index e6d91c0..71dd352 100644 --- a/src/Serilog.Settings.Configuration/Serilog.Settings.Configuration.csproj +++ b/src/Serilog.Settings.Configuration/Serilog.Settings.Configuration.csproj @@ -15,7 +15,7 @@ Serilog.Settings.Configuration serilog;json icon.png - https://serilog.net/ + https://github.com/serilog/serilog-settings-configuration/ Apache-2.0 Serilog true diff --git a/src/Serilog.Settings.Configuration/Settings/Configuration/Assemblies/DependencyContextAssemblyFinder.cs b/src/Serilog.Settings.Configuration/Settings/Configuration/Assemblies/DependencyContextAssemblyFinder.cs index d7faa77..e14283e 100644 --- a/src/Serilog.Settings.Configuration/Settings/Configuration/Assemblies/DependencyContextAssemblyFinder.cs +++ b/src/Serilog.Settings.Configuration/Settings/Configuration/Assemblies/DependencyContextAssemblyFinder.cs @@ -18,11 +18,17 @@ public DependencyContextAssemblyFinder(DependencyContext dependencyContext) public override IReadOnlyList FindAssembliesContainingName(string nameToFind) { var query = from library in _dependencyContext.RuntimeLibraries + where IsReferencingSerilog(library) from assemblyName in library.GetDefaultAssemblyNames(_dependencyContext) where IsCaseInsensitiveMatch(assemblyName.Name, nameToFind) select assemblyName; return query.ToList().AsReadOnly(); + + static bool IsReferencingSerilog(Library library) + { + return library.Dependencies.Any(dependency => dependency.Name.Equals("serilog", StringComparison.OrdinalIgnoreCase)); + } } } } diff --git a/src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs b/src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs index 29a13cf..4a5aa71 100644 --- a/src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs +++ b/src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs @@ -264,7 +264,8 @@ internal static IConfigurationArgumentValue GetArgumentValue(IConfigurationSecti static IReadOnlyCollection LoadConfigurationAssemblies(IConfigurationSection section, AssemblyFinder assemblyFinder) { - var assemblies = new Dictionary(); + var serilogAssembly = typeof(ILogger).Assembly; + var assemblies = new Dictionary { [serilogAssembly.FullName] = serilogAssembly }; var usingSection = section.GetSection("Using"); if (usingSection.GetChildren().Any())