Skip to content

Commit

Permalink
Merge pull request #219 from skomis-mm/reduceGraph
Browse files Browse the repository at this point in the history
Reduce search graph for auto discovery
  • Loading branch information
Sergey Komisarchik authored May 12, 2020
2 parents 8bea591 + a1d539a commit bd779e5
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 34 deletions.
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

19 changes: 17 additions & 2 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
12 changes: 10 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,7 +21,6 @@ deploy:
- provider: NuGet
api_key:
secure: b7jxRe5kR3kuxMrmdDuN0jvaaWWHwtFRnAwFZZV6MdaorwUhASR/Ey1gPn6vXwND
skip_symbols: true
on:
branch: /^(master|dev)$/
- provider: GitHub
Expand Down
17 changes: 0 additions & 17 deletions build.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageId>Serilog.Settings.Configuration</PackageId>
<PackageTags>serilog;json</PackageTags>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://serilog.net/</PackageProjectUrl>
<PackageProjectUrl>https://github.com/serilog/serilog-settings-configuration/</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RootNamespace>Serilog</RootNamespace>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ public DependencyContextAssemblyFinder(DependencyContext dependencyContext)
public override IReadOnlyList<AssemblyName> 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));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ internal static IConfigurationArgumentValue GetArgumentValue(IConfigurationSecti

static IReadOnlyCollection<Assembly> LoadConfigurationAssemblies(IConfigurationSection section, AssemblyFinder assemblyFinder)
{
var assemblies = new Dictionary<string, Assembly>();
var serilogAssembly = typeof(ILogger).Assembly;
var assemblies = new Dictionary<string, Assembly> { [serilogAssembly.FullName] = serilogAssembly };

var usingSection = section.GetSection("Using");
if (usingSection.GetChildren().Any())
Expand Down

0 comments on commit bd779e5

Please sign in to comment.