Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce search graph for auto discovery #219

Merged
merged 4 commits into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.ToLowerInvariant() == "serilog");
skomis-mm marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
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