From 4225e093f526e374a47fae3939b862dc4c6fe842 Mon Sep 17 00:00:00 2001 From: Alistair Evans Date: Sat, 5 Sep 2020 10:22:43 +0100 Subject: [PATCH 01/11] Nuspec Compatibility with v6 + CLS Compliance --- Autofac.WebApi.Owin.sln | 23 +++++++++++++++++-- appveyor.yml | 4 ++-- .../Autofac.Integration.WebApi.Owin.nuspec | 6 ++--- .../Properties/AssemblyInfo.cs | 2 +- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Autofac.WebApi.Owin.sln b/Autofac.WebApi.Owin.sln index 0633aca..e78debe 100644 --- a/Autofac.WebApi.Owin.sln +++ b/Autofac.WebApi.Owin.sln @@ -1,12 +1,24 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autofac.Integration.WebApi.Owin", "src\Autofac.Integration.WebApi.Owin\Autofac.Integration.WebApi.Owin.csproj", "{1A3E68CF-E1D5-4E30-96C3-9B8687DF9283}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autofac.Integration.WebApi.Owin.Test", "test\Autofac.Integration.WebApi.Owin.Test\Autofac.Integration.WebApi.Owin.Test.csproj", "{2EF2FBB2-77D0-4D85-936E-5A00881CF5F6}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D372C752-2D55-4E5D-943B-CEDD5BD00747}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9AD9DBFC-4F7F-4EEB-98D5-AD23D64B7518}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{01223B84-9EDA-4971-AEFE-491579D4E1D7}" + ProjectSection(SolutionItems) = preProject + appveyor.yml = appveyor.yml + LICENSE = LICENSE + NuGet.Config = NuGet.Config + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -25,4 +37,11 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {1A3E68CF-E1D5-4E30-96C3-9B8687DF9283} = {D372C752-2D55-4E5D-943B-CEDD5BD00747} + {2EF2FBB2-77D0-4D85-936E-5A00881CF5F6} = {9AD9DBFC-4F7F-4EEB-98D5-AD23D64B7518} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {12B13373-B4BB-41C8-BD7E-73095EB2DEEB} + EndGlobalSection EndGlobal diff --git a/appveyor.yml b/appveyor.yml index 133e268..9e376e5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ environment: - package_semantic_version: 5.0.0 - assembly_semantic_version: 5.0.0 + package_semantic_version: 6.0.0 + assembly_semantic_version: 6.0.0 version: $(package_semantic_version).{build} diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec index 4295e6f..055848d 100644 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec +++ b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec @@ -14,9 +14,9 @@ https://cloud.githubusercontent.com/assets/1156571/13684110/16b8f152-e6bf-11e5-84ae-22c66c6d351a.png Release notes are at https://github.com/autofac/Autofac.WebApi.Owin/releases - - - + + + diff --git a/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs b/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs index 416790a..7ef9ee9 100644 --- a/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs +++ b/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs @@ -7,7 +7,7 @@ [assembly: AssemblyTitle("Autofac.Integration.WebApi.Owin")] [assembly: InternalsVisibleTo("Autofac.Integration.WebApi.Owin.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")] [assembly: ComVisible(false)] -[assembly: CLSCompliant(true)] +[assembly: CLSCompliant(false)] [assembly: AssemblyCompany("Autofac Project - https://autofac.org")] [assembly: AssemblyProduct("Autofac")] [assembly: AssemblyTrademark("")] From 26b17a2fe08be6ada40aa5d0ca70e6d76d7a81c3 Mon Sep 17 00:00:00 2001 From: Alistair Evans Date: Mon, 28 Sep 2020 08:32:19 +0100 Subject: [PATCH 02/11] Switch to net472 and upgrade project style to SDK --- Autofac.WebApi.Owin.sln | 5 +- CodeAnalysisDictionary.xml | 47 ------- Full.ruleset | 12 -- NuGet.Config | 3 - appveyor.yml | 41 +++--- build.ps1 | 46 +++++++ global.json | 6 + .../Autofac.Integration.WebApi.Owin.csproj | 125 ++++++------------ .../Autofac.Integration.WebApi.Owin.nuspec | 22 --- .../AutofacWebApiAppBuilderExtensions.cs | 4 +- .../DependencyScopeHandler.cs | 7 +- .../Properties/AssemblyInfo.cs | 14 -- ...utofac.Integration.WebApi.Owin.Test.csproj | 96 +------------- .../Properties/AssemblyInfo.cs | 3 - 14 files changed, 131 insertions(+), 300 deletions(-) delete mode 100644 CodeAnalysisDictionary.xml delete mode 100644 Full.ruleset create mode 100644 build.ps1 create mode 100644 global.json delete mode 100644 src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec delete mode 100644 test/Autofac.Integration.WebApi.Owin.Test/Properties/AssemblyInfo.cs diff --git a/Autofac.WebApi.Owin.sln b/Autofac.WebApi.Owin.sln index e78debe..96ed31f 100644 --- a/Autofac.WebApi.Owin.sln +++ b/Autofac.WebApi.Owin.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autofac.Integration.WebApi.Owin", "src\Autofac.Integration.WebApi.Owin\Autofac.Integration.WebApi.Owin.csproj", "{1A3E68CF-E1D5-4E30-96C3-9B8687DF9283}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Autofac.Integration.WebApi.Owin", "src\Autofac.Integration.WebApi.Owin\Autofac.Integration.WebApi.Owin.csproj", "{1A3E68CF-E1D5-4E30-96C3-9B8687DF9283}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autofac.Integration.WebApi.Owin.Test", "test\Autofac.Integration.WebApi.Owin.Test\Autofac.Integration.WebApi.Owin.Test.csproj", "{2EF2FBB2-77D0-4D85-936E-5A00881CF5F6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Autofac.Integration.WebApi.Owin.Test", "test\Autofac.Integration.WebApi.Owin.Test\Autofac.Integration.WebApi.Owin.Test.csproj", "{2EF2FBB2-77D0-4D85-936E-5A00881CF5F6}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D372C752-2D55-4E5D-943B-CEDD5BD00747}" EndProject @@ -14,6 +14,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{01223B84-9EDA-4971-AEFE-491579D4E1D7}" ProjectSection(SolutionItems) = preProject appveyor.yml = appveyor.yml + global.json = global.json LICENSE = LICENSE NuGet.Config = NuGet.Config README.md = README.md diff --git a/CodeAnalysisDictionary.xml b/CodeAnalysisDictionary.xml deleted file mode 100644 index 0f1b469..0000000 --- a/CodeAnalysisDictionary.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - Api - Autofac - autowired - autowiring - composable - configurator - Ioc - Mef - Moq - multitenancy - Mvc - Mvx - Mvvm - startable - Owin - - - - - diff --git a/Full.ruleset b/Full.ruleset deleted file mode 100644 index 417a489..0000000 --- a/Full.ruleset +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/NuGet.Config b/NuGet.Config index c62bcf4..e0e3e4e 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -6,7 +6,4 @@ - - - diff --git a/appveyor.yml b/appveyor.yml index 9e376e5..7e36a41 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,32 +1,33 @@ -environment: - package_semantic_version: 6.0.0 - assembly_semantic_version: 6.0.0 +version: 6.0.0.{build} -version: $(package_semantic_version).{build} +dotnet_csproj: + version_prefix: '6.0.0' + patch: true + file: 'src\**\*.csproj' + +configuration: Release image: Visual Studio 2019 -assembly_info: - patch: true - file: '**\AssemblyInfo.*' - assembly_version: '$(assembly_semantic_version).0' - assembly_file_version: '$(appveyor_build_version)' - assembly_informational_version: '$(package_semantic_version)-CI-{build}' +environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + NUGET_XMLDOC_MODE: skip -configuration: Release +skip_tags: true + +nuget: + disable_publish_on_pr: true + +clone_depth: 1 -before_build: -- nuget restore +test: off -build: - verbosity: minimal - publish_nuget: true - publish_nuget_symbols: true +build_script: +- ps: .\build.ps1 deploy: - provider: NuGet - server: https://www.myget.org/F/autofac/api/v2/package + server: https://www.myget.org/F/autofac/ api_key: secure: rCUEY75fXN0wxtMy6QL4jCrLdaYbxIBzIXWeN+wEu/XDpyqimzreOc5AH5jMd5ah - skip_symbols: true - symbol_server: https://www.myget.org/F/autofac/symbols/api/v2/package + symbol_server: https://nuget.symbolsource.org/MyGet/autofac diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..1d154bd --- /dev/null +++ b/build.ps1 @@ -0,0 +1,46 @@ +######################## +# THE BUILD! +######################## + +Push-Location $PSScriptRoot +Import-Module $PSScriptRoot\Build\Autofac.Build.psd1 -Force + +$artifactsPath = "$PSScriptRoot\artifacts" +$packagesPath = "$artifactsPath\packages" +$sdkVersion = (Get-Content "$PSScriptRoot\global.json" | ConvertFrom-Json).sdk.version + +# Clean up artifacts folder +if (Test-Path $artifactsPath) { + Write-Message "Cleaning $artifactsPath folder" + Remove-Item $artifactsPath -Force -Recurse +} + +# Install dotnet CLI +Write-Message "Installing .NET Core SDK version $sdkVersion" +Install-DotNetCli -Version $sdkVersion + +# Write out dotnet information +& dotnet --info + +# Set version suffix +$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL]; +$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; +$versionSuffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"] + +Write-Message "Package version suffix is '$versionSuffix'" + +# Package restore +Write-Message "Restoring packages" +Get-DotNetProjectDirectory -RootPath $PSScriptRoot | Restore-DependencyPackages + +# Build/package +Write-Message "Building projects and packages" +Get-DotNetProjectDirectory -RootPath $PSScriptRoot\src | Invoke-DotNetPack -PackagesPath $packagesPath -VersionSuffix $versionSuffix + +# Test +Write-Message "Executing unit tests" +Get-DotNetProjectDirectory -RootPath $PSScriptRoot\test | Invoke-Test + +# Finished +Write-Message "Build finished" +Pop-Location diff --git a/global.json b/global.json new file mode 100644 index 0000000..14d6b1b --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "3.1.301", + "rollForward": "latestFeature" + } +} diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj index b7468e1..0e302b0 100644 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj +++ b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj @@ -1,98 +1,57 @@ - - - - - Debug - AnyCPU - {1A3E68CF-E1D5-4E30-96C3-9B8687DF9283} - Library - Properties - Autofac.Integration.WebApi.Owin - Autofac.Integration.WebApi.Owin - v4.6.1 - 512 - ..\..\..\..\ - true - - /assemblyCompareMode:StrongNameIgnoringVersion - - - true - full - false - bin\Debug\ - TRACE;DEBUG;CODE_ANALYSIS - prompt - 4 - true - ..\..\Full.ruleset - bin\Debug\Autofac.Integration.WebApi.Owin.xml - - - pdbonly - true - bin\Release\ - TRACE;CODE_ANALYSIS - prompt - 4 - true - ..\..\Full.ruleset - bin\Release\Autofac.Integration.WebApi.Owin.xml - + + net472 true - - + + 0.0.1 ..\..\Autofac.snk + ..\..\build\Analyzers.ruleset + https://github.com/autofac/Autofac.WebApi.Owin + true + icon.png + https://autofac.org + MIT + Release notes are at https://github.com/autofac/Autofac.WebApi.Owin/releases + Autofac + Autofac Contributors + Autofac + en-US + Autofac Web API Owin Integration + Copyright © 2014 Autofac Contributors + true + true + ../../build/Analyzers.ruleset + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + - - - - - - - - + + - - - - - - - - - - - CodeAnalysisDictionary.xml - Designer - + + + - - 5.0.0 - - - 5.0.1 + + + + + + + All - - 5.0.0 + + all + runtime; build; native; contentfiles; analyzers; buildtransitive - - 5.2.0 + + All - - 5.0.8 + + All - - \ No newline at end of file diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec deleted file mode 100644 index 055848d..0000000 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - - Autofac.WebApi2.Owin - $version$ - Autofac Contributors - https://opensource.org/licenses/mit-license.php - false - OWIN support for the ASP.NET Web API 2.2 Integration for Autofac - Allows an Autofac lifetime scope to extend from the OWIN pipeline through to ASP.NET Web API. - en-US - Autofac ASP.NET Web API 2.2 OWIN Integration - https://autofac.org - https://cloud.githubusercontent.com/assets/1156571/13684110/16b8f152-e6bf-11e5-84ae-22c66c6d351a.png - Release notes are at https://github.com/autofac/Autofac.WebApi.Owin/releases - - - - - - - diff --git a/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs b/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs index 1132118..4176c23 100644 --- a/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs +++ b/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs @@ -52,12 +52,12 @@ public static IAppBuilder UseAutofacWebApi(this IAppBuilder app, HttpConfigurati { if (app == null) { - throw new ArgumentNullException("app"); + throw new ArgumentNullException(nameof(app)); } if (configuration == null) { - throw new ArgumentNullException("configuration"); + throw new ArgumentNullException(nameof(configuration)); } if (!configuration.MessageHandlers.OfType().Any()) diff --git a/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs b/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs index 8d21a60..39036c5 100644 --- a/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs +++ b/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs @@ -10,13 +10,16 @@ namespace Autofac.Integration.WebApi.Owin { [SecurityCritical] - class DependencyScopeHandler : DelegatingHandler + internal class DependencyScopeHandler : DelegatingHandler { [SecuritySafeCritical] [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { - if (request == null) throw new ArgumentNullException("request"); + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } var owinContext = request.GetOwinContext(); if (owinContext == null) return base.SendAsync(request, cancellationToken); diff --git a/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs b/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs index 7ef9ee9..f27613a 100644 --- a/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs +++ b/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs @@ -1,21 +1,7 @@ using System; -using System.Reflection; -using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Autofac.Integration.WebApi.Owin")] [assembly: InternalsVisibleTo("Autofac.Integration.WebApi.Owin.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")] [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] -[assembly: AssemblyCompany("Autofac Project - https://autofac.org")] -[assembly: AssemblyProduct("Autofac")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] -[assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.0.0.0")] -[assembly: AssemblyInformationalVersion("0.0.0")] -[assembly: AssemblyConfiguration("Release")] -[assembly: AssemblyCopyright("Copyright © 2014 Autofac Contributors")] -[assembly: AssemblyDescription("Autofac Web API OWIN Integration")] \ No newline at end of file diff --git a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj index 61cddeb..36392bf 100644 --- a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj +++ b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj @@ -1,99 +1,15 @@ - - - - - Debug - AnyCPU - {2EF2FBB2-77D0-4D85-936E-5A00881CF5F6} - Library - Properties - Autofac.Integration.WebApi.Owin.Test - Autofac.Integration.WebApi.Owin.Test - v4.6.1 - 512 - ..\..\..\ - true - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - + + net472 true - - ..\..\Autofac.snk - - - - - - - - - - - - - {1a3e68cf-e1d5-4e30-96c3-9b8687df9283} - Autofac.Integration.WebApi.Owin - - - - - - - + - - 5.0.0 - - - 5.0.1 - - - 5.0.0 - - - 5.2.0 - - - 5.0.8 - - - 2.1.0 - - - 2.1.0 - - - 2.1.0 - + + + - - \ No newline at end of file diff --git a/test/Autofac.Integration.WebApi.Owin.Test/Properties/AssemblyInfo.cs b/test/Autofac.Integration.WebApi.Owin.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 6c94b2e..0000000 --- a/test/Autofac.Integration.WebApi.Owin.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyTitle("Autofac.Integration.WebApi.Owin.Test")] From a4f32b78c5bf5d4f5b442c10babab619d0a174e5 Mon Sep 17 00:00:00 2001 From: Alistair Evans Date: Mon, 28 Sep 2020 08:36:58 +0100 Subject: [PATCH 03/11] Correct git ignore to include build folder --- .gitignore | 1 - Autofac.WebApi.Owin.sln | 1 + build/Analyzers.ruleset | 63 ++++++++ build/Autofac.Build.psd1 | 15 ++ build/Autofac.Build.psm1 | 250 +++++++++++++++++++++++++++++++ build/CodeAnalysisDictionary.xml | 47 ++++++ build/icon.png | Bin 0 -> 7062 bytes 7 files changed, 376 insertions(+), 1 deletion(-) create mode 100644 build/Analyzers.ruleset create mode 100644 build/Autofac.Build.psd1 create mode 100644 build/Autofac.Build.psm1 create mode 100644 build/CodeAnalysisDictionary.xml create mode 100644 build/icon.png diff --git a/.gitignore b/.gitignore index b4ac624..1f602a7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ project.lock.json [Rr]eleases/ x64/ x86/ -build/ bld/ [Bb]in/ [Oo]bj/ diff --git a/Autofac.WebApi.Owin.sln b/Autofac.WebApi.Owin.sln index 96ed31f..a82a493 100644 --- a/Autofac.WebApi.Owin.sln +++ b/Autofac.WebApi.Owin.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9AD9DBFC-4 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{01223B84-9EDA-4971-AEFE-491579D4E1D7}" ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore appveyor.yml = appveyor.yml global.json = global.json LICENSE = LICENSE diff --git a/build/Analyzers.ruleset b/build/Analyzers.ruleset new file mode 100644 index 0000000..632dd4a --- /dev/null +++ b/build/Analyzers.ruleset @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/Autofac.Build.psd1 b/build/Autofac.Build.psd1 new file mode 100644 index 0000000..5d93715 --- /dev/null +++ b/build/Autofac.Build.psd1 @@ -0,0 +1,15 @@ +@{ + RootModule = '.\Autofac.Build.psm1' + ModuleVersion = '0.2.0' + GUID = '55d3f738-f48f-4497-9b2c-ecd90ec1f978' + Author = 'Autofac Contributors' + CompanyName = 'Autofac' + Description = 'Build support for Autofac projects.' + FunctionsToExport = '*' + CmdletsToExport = '*' + VariablesToExport = '*' + AliasesToExport = '*' + ModuleList = @() + FileList = @() + PrivateData = '' +} \ No newline at end of file diff --git a/build/Autofac.Build.psm1 b/build/Autofac.Build.psm1 new file mode 100644 index 0000000..6cefea0 --- /dev/null +++ b/build/Autofac.Build.psm1 @@ -0,0 +1,250 @@ +# EXIT CODES +# 1: dotnet packaging failure +# 2: dotnet publishing failure +# 3: Unit test failure +# 4: dotnet / NuGet package restore failure + +<# + .SYNOPSIS + Writes a build progress message to the host. + + .PARAMETER Message + The message to write. +#> +function Write-Message +{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$True, ValueFromPipeline=$False, ValueFromPipelineByPropertyName=$False)] + [ValidateNotNullOrEmpty()] + [string] + $Message + ) + + Write-Host "[BUILD] $Message" -ForegroundColor Cyan +} + +<# + .SYNOPSIS + Gets the set of directories in which projects are available for compile/processing. + + .PARAMETER RootPath + Path where searching for project directories should begin. +#> +function Get-DotNetProjectDirectory +{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$True, ValueFromPipeline=$False, ValueFromPipelineByPropertyName=$False)] + [ValidateNotNullOrEmpty()] + [string] + $RootPath + ) + + Get-ChildItem -Path $RootPath -Recurse -Include "*.csproj" | Select-Object @{ Name="ParentFolder"; Expression={ $_.Directory.FullName.TrimEnd("\") } } | Select-Object -ExpandProperty ParentFolder +} + +<# + .SYNOPSIS + Runs the dotnet CLI install script from GitHub to install a project-local + copy of the CLI. +#> +function Install-DotNetCli +{ + [CmdletBinding()] + Param( + [string] + $Version = "Latest" + ) + + if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue)) + { + $installedVersion = dotnet --version + if ($installedVersion -eq $Version) + { + Write-Message ".NET Core SDK version $Version is already installed" + return; + } + } + + $callerPath = Split-Path $MyInvocation.PSCommandPath + $installDir = Join-Path -Path $callerPath -ChildPath ".dotnet\cli" + if (!(Test-Path $installDir)) + { + New-Item -ItemType Directory -Path "$installDir" | Out-Null + } + + # Download the dotnet CLI install script + if (!(Test-Path .\dotnet\install.ps1)) + { + Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile ".\.dotnet\dotnet-install.ps1" + } + + # Run the dotnet CLI install + & .\.dotnet\dotnet-install.ps1 -InstallDir "$installDir" -Version $Version + + # Add the dotnet folder path to the process. + $env:PATH = "$installDir;$env:PATH" +} + +<# +.SYNOPSIS + Builds a project using dotnet cli. +.DESCRIPTION + Builds a project in a specified directory using the dotnet cli. +.PARAMETER DirectoryName + The path to the directory containing the project to build. +#> +function Invoke-DotNetBuild +{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] + [ValidateNotNull()] + [System.IO.DirectoryInfo[]] + $ProjectDirectory + ) + Process + { + foreach($Project in $ProjectDirectory) + { + & dotnet build ("""" + $Project.FullName + """") --configuration Release + if ($LASTEXITCODE -ne 0) + { + exit 1 + } + } + } +} + +<# + .SYNOPSIS + Invokes the dotnet utility to package a project. + + .PARAMETER ProjectDirectory + Path to the directory containing the project to package. + + .PARAMETER PackagesPath + Path to the "artifacts\packages" folder where packages should go. + + .PARAMETER VersionSuffix + The version suffix to use for the NuGet package version. +#> +function Invoke-DotNetPack +{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] + [ValidateNotNull()] + [System.IO.DirectoryInfo[]] + $ProjectDirectory, + + [Parameter(Mandatory=$True, ValueFromPipeline=$False)] + [ValidateNotNull()] + [System.IO.DirectoryInfo] + $PackagesPath, + + [Parameter(Mandatory=$True, ValueFromPipeline=$False)] + [AllowEmptyString()] + [string] + $VersionSuffix + ) + Begin + { + New-Item -Path $PackagesPath -ItemType Directory -Force | Out-Null + } + Process + { + foreach($Project in $ProjectDirectory) + { + if ($VersionSuffix -eq "") + { + & dotnet build ("""" + $Project.FullName + """") --configuration Release + } + else + { + & dotnet build ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix + } + if ($LASTEXITCODE -ne 0) + { + exit 1 + } + + if ($VersionSuffix -eq "") + { + & dotnet pack ("""" + $Project.FullName + """") --configuration Release --output $PackagesPath + } + else + { + & dotnet pack ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix --output $PackagesPath + } + if ($LASTEXITCODE -ne 0) + { + exit 1 + } + } + } +} + +<# + .Synopsis + Invokes dotnet test command. + + .Parameter ProjectDirectory + Path to the directory containing the project to package. +#> +function Invoke-Test +{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] + [ValidateNotNull()] + [System.IO.DirectoryInfo[]] + $ProjectDirectory + ) + Process + { + foreach($Project in $ProjectDirectory) + { + Push-Location $Project + + & dotnet test --configuration Release --logger:trx + if ($LASTEXITCODE -ne 0) + { + Pop-Location + exit 3 + } + + Pop-Location + } + } +} + +<# + .SYNOPSIS + Restores dependencies using the dotnet utility. + + .PARAMETER ProjectDirectory + Path to the directory containing the project with dependencies to restore. +#> +function Restore-DependencyPackages +{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] + [ValidateNotNull()] + [System.IO.DirectoryInfo[]] + $ProjectDirectory + ) + Process + { + foreach($Project in $ProjectDirectory) + { + & dotnet restore ("""" + $Project.FullName + """") --no-cache + if($LASTEXITCODE -ne 0) + { + exit 4 + } + } + } +} diff --git a/build/CodeAnalysisDictionary.xml b/build/CodeAnalysisDictionary.xml new file mode 100644 index 0000000..0f1b469 --- /dev/null +++ b/build/CodeAnalysisDictionary.xml @@ -0,0 +1,47 @@ + + + + + + + + Api + Autofac + autowired + autowiring + composable + configurator + Ioc + Mef + Moq + multitenancy + Mvc + Mvx + Mvvm + startable + Owin + + + + + diff --git a/build/icon.png b/build/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4405a81dfa3f4af99278c866b9f715a1f947cb45 GIT binary patch literal 7062 zcmZ{J2RK|^*Y+8N(OZP5qZ<>WMfA~2BuexM1_`3XU`B7Fg+zkr5?zppF3~4iM1n9x zM3iU|qu1!e$MZb@`@a8secw6PK5Lz|?t87Z&pzea`#dr-(4nPbrvdpgMv2*#5%VIpnUcu|5C<3Z3Di0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%75rY`cVYIr`$-#_T((Z8`+bSn<9KSj&qvkC*ScJK4+@$RxGX zCKUcCBl9JG+}>xqTf#P0_TCO{iCkK+zFvv;wk-wL3>bmL+l6xRG~B;lWv21uu;zBi zE6B}0ydtK2K8EIx0+8YJi?*bBL%mzJ{o?-RnW49n(YCSmxTzf{W@)mvVERFiCfE4y zy?}%|YkNlSZqN4e>LrEl$eK+|LR<5N-+y32IZZzgAH~~V0HW!}s%PqhLUE+)aLm2W zI2J~VkX@M+wZ6j%tsbFTPGUu=S}T5Y9L z${sshMiPuHrgKPh;s~Qlg-A8T{_Zs+^Z5L4({(Ka%?fq9i2nft ChO&?V literal 0 HcmV?d00001 From e2eeb0f24f4b7c2c01ac718007af720cdda7f2cf Mon Sep 17 00:00:00 2001 From: Alistair Evans Date: Mon, 28 Sep 2020 08:40:17 +0100 Subject: [PATCH 04/11] Correct package references --- .../Autofac.Integration.WebApi.Owin.csproj | 5 ----- test/Autofac.Integration.WebApi.Owin.Test/App.config | 2 +- .../Autofac.Integration.WebApi.Owin.Test.csproj | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj index 0e302b0..1f2eaf6 100644 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj +++ b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj @@ -28,11 +28,6 @@ - - - - - diff --git a/test/Autofac.Integration.WebApi.Owin.Test/App.config b/test/Autofac.Integration.WebApi.Owin.Test/App.config index 1eae6d8..250332c 100644 --- a/test/Autofac.Integration.WebApi.Owin.Test/App.config +++ b/test/Autofac.Integration.WebApi.Owin.Test/App.config @@ -12,7 +12,7 @@ - + diff --git a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj index 36392bf..08fb6d2 100644 --- a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj +++ b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj @@ -8,6 +8,7 @@ + From 88b22b15946573e50bf41abf1fdc21ea94b1991b Mon Sep 17 00:00:00 2001 From: Alistair Evans Date: Mon, 28 Sep 2020 08:50:19 +0100 Subject: [PATCH 05/11] Update xunit packages for compatibility with dotnet test --- .../Autofac.Integration.WebApi.Owin.Test.csproj | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj index 08fb6d2..dd81da7 100644 --- a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj +++ b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj @@ -9,8 +9,14 @@ - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + \ No newline at end of file From 48ee2531eb846de9f2c09f6ff94d563553492cc1 Mon Sep 17 00:00:00 2001 From: Craig Boland Date: Mon, 5 Oct 2020 12:47:44 -0500 Subject: [PATCH 06/11] Autofac v6 Upgrade --- .../Autofac.Integration.WebApi.Owin.csproj | 6 +++--- .../Autofac.Integration.WebApi.Owin.Test.csproj | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj index 1f2eaf6..091d909 100644 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj +++ b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj @@ -30,9 +30,9 @@ - - - + + + diff --git a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj index dd81da7..a0624aa 100644 --- a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj +++ b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj @@ -8,7 +8,7 @@ - + all From 87c2cc35f46ab88fb3a7d5c20a497201029a9d12 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Mon, 5 Oct 2020 15:05:23 -0700 Subject: [PATCH 07/11] Updated build, analyzers. Fixed related issues. --- .editorconfig | 186 ++++++++++++++++-- build/Analyzers.ruleset | 39 +--- build/CodeAnalysisDictionary.xml | 47 ----- .../Autofac.Integration.WebApi.Owin.csproj | 6 +- .../AutofacWebApiAppBuilderExtensions.cs | 30 +-- .../DependencyScopeHandler.cs | 25 ++- .../Properties/AssemblyInfo.cs | 5 +- .../app.config | 15 -- ...utofac.Integration.WebApi.Owin.Test.csproj | 1 - ...utofacWebApiAppBuilderExtensionsFixture.cs | 6 +- 10 files changed, 213 insertions(+), 147 deletions(-) delete mode 100644 build/CodeAnalysisDictionary.xml delete mode 100644 src/Autofac.Integration.WebApi.Owin/app.config diff --git a/.editorconfig b/.editorconfig index 8bbed11..9337e41 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,23 +6,185 @@ root = true [*] -end_of_line = CRLF - -[*.{config,cs,json,xml}] indent_style = space -indent_size = 4 trim_trailing_whitespace = true +insert_final_newline = true + +; .NET Code - almost, but not exactly, the same suggestions as corefx +; https://github.com/dotnet/corefx/blob/master/.editorconfig +[*.cs] +indent_size = 4 +charset = utf-8-bom + +; New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +; Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current + +; Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion + +; Avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +; Types: use keywords instead of BCL types, using var is fine. +csharp_style_var_when_type_is_apparent = false:none +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +; Name all constant fields using PascalCase +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +; Static fields should be PascalCase +dotnet_naming_rule.static_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.static_fields_should_be_pascal_case.symbols = static_fields +dotnet_naming_rule.static_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static +dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected + +; Internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +; Code style defaults +csharp_using_directive_placement = outside_namespace:suggestion +dotnet_sort_system_directives_first = true +csharp_prefer_braces = true:refactoring +csharp_preserve_single_line_blocks = true:none +csharp_preserve_single_line_statements = false:none +csharp_prefer_static_local_function = true:suggestion +csharp_prefer_simple_using_statement = false:none +csharp_style_prefer_switch_expression = true:suggestion + +; Code quality +dotnet_style_readonly_field = true:suggestion +dotnet_code_quality_unused_parameters = non_public:suggestion + +; Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:refactoring +dotnet_style_prefer_conditional_expression_over_return = true:refactoring +csharp_prefer_simple_default_expression = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = true:refactoring +csharp_style_expression_bodied_constructors = true:refactoring +csharp_style_expression_bodied_operators = true:refactoring +csharp_style_expression_bodied_properties = true:refactoring +csharp_style_expression_bodied_indexers = true:refactoring +csharp_style_expression_bodied_accessors = true:refactoring +csharp_style_expression_bodied_lambdas = true:refactoring +csharp_style_expression_bodied_local_functions = true:refactoring + +# Pattern matching +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Other features +csharp_style_prefer_index_operator = false:none +csharp_style_prefer_range_operator = false:none +csharp_style_pattern_local_over_anonymous_function = false:none + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = do_not_ignore +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false -[*.{proj,props,sln,targets}] +; .NET project files and MSBuild - match defaults for VS +[*.{csproj,nuspec,proj,projitems,props,shproj,targets,vbproj,vcxproj,vcxproj.filters,vsixmanifest,vsct}] +indent_size = 2 + +; .NET solution files - match defaults for VS +[*.sln] indent_style = tab -trim_trailing_whitespace = true -[*.{kproj,csproj,ps1,resx,rst}] -indent_style = space +; Config - match XML and default nuget.config template +[*.config] indent_size = 2 -trim_trailing_whitespace = true -[NuGet.Config] -indent_style = space +; Resources - match defaults for VS +[*.resx] +indent_size = 2 + +; Static analysis rulesets - match defaults for VS +[*.ruleset] +indent_size = 2 + +; HTML, XML - match defaults for VS +[*.{cshtml,html,xml}] +indent_size = 4 + +; JavaScript and JS mixes - match eslint settings; JSON also matches .NET Core templates +[*.{js,json,ts,vue}] +indent_size = 2 + +; Markdown - match markdownlint settings +[*.{md,markdown}] +indent_size = 2 + +; PowerShell - match defaults for New-ModuleManifest and PSScriptAnalyzer Invoke-Formatter +[*.{ps1,psd1,psm1}] +indent_size = 4 +charset = utf-8-bom + +; ReStructuredText - standard indentation format from examples +[*.rst] indent_size = 2 -trim_trailing_whitespace = true diff --git a/build/Analyzers.ruleset b/build/Analyzers.ruleset index 632dd4a..5a0a0b7 100644 --- a/build/Analyzers.ruleset +++ b/build/Analyzers.ruleset @@ -1,16 +1,11 @@  - - + - - - - @@ -25,39 +20,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/build/CodeAnalysisDictionary.xml b/build/CodeAnalysisDictionary.xml deleted file mode 100644 index 0f1b469..0000000 --- a/build/CodeAnalysisDictionary.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - Api - Autofac - autowired - autowiring - composable - configurator - Ioc - Mef - Moq - multitenancy - Mvc - Mvx - Mvvm - startable - Owin - - - - - diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj index 091d909..f2ff3b6 100644 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj +++ b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj @@ -28,7 +28,11 @@ - + + + + + diff --git a/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs b/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs index 4176c23..69e00dd 100644 --- a/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs +++ b/src/Autofac.Integration.WebApi.Owin/AutofacWebApiAppBuilderExtensions.cs @@ -1,27 +1,5 @@ -// This software is part of the Autofac IoC container -// Copyright © 2014 Autofac Contributors -// https://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. +// Copyright (c) Autofac Project. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. using System; using System.ComponentModel; @@ -43,11 +21,11 @@ public static class AutofacWebApiAppBuilderExtensions /// /// The application builder. /// The HTTP server configuration. - /// The application builder. + /// The application builder for continued configuration. /// /// Thrown if or is . /// - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] + [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The handler created must exist for the entire application lifetime.")] public static IAppBuilder UseAutofacWebApi(this IAppBuilder app, HttpConfiguration configuration) { if (app == null) diff --git a/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs b/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs index 39036c5..bac0030 100644 --- a/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs +++ b/src/Autofac.Integration.WebApi.Owin/DependencyScopeHandler.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Autofac Project. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using System; using System.Diagnostics.CodeAnalysis; using System.Net.Http; using System.Security; @@ -9,11 +12,19 @@ namespace Autofac.Integration.WebApi.Owin { + /// + /// Delegating handler that manages coordinating the OWIN request lifetime with the Web API request lifetime. + /// [SecurityCritical] internal class DependencyScopeHandler : DelegatingHandler { + /// + /// Assigns the OWIN request lifetime scope to the Web API request lifetime scope. + /// + /// The HTTP request message to send to the server. + /// A cancellation token to cancel the operation. + /// The task object representing the asynchronous operation. [SecuritySafeCritical] - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { if (request == null) @@ -22,10 +33,16 @@ protected override Task SendAsync(HttpRequestMessage reques } var owinContext = request.GetOwinContext(); - if (owinContext == null) return base.SendAsync(request, cancellationToken); + if (owinContext == null) + { + return base.SendAsync(request, cancellationToken); + } var lifetimeScope = owinContext.GetAutofacLifetimeScope(); - if (lifetimeScope == null) return base.SendAsync(request, cancellationToken); + if (lifetimeScope == null) + { + return base.SendAsync(request, cancellationToken); + } var dependencyScope = new AutofacWebApiDependencyScope(lifetimeScope); request.Properties[HttpPropertyKeys.DependencyScope] = dependencyScope; diff --git a/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs b/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs index f27613a..eef849b 100644 --- a/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs +++ b/src/Autofac.Integration.WebApi.Owin/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Autofac Project. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/src/Autofac.Integration.WebApi.Owin/app.config b/src/Autofac.Integration.WebApi.Owin/app.config deleted file mode 100644 index 81e81a2..0000000 --- a/src/Autofac.Integration.WebApi.Owin/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj index a0624aa..42718d6 100644 --- a/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj +++ b/test/Autofac.Integration.WebApi.Owin.Test/Autofac.Integration.WebApi.Owin.Test.csproj @@ -8,7 +8,6 @@ - all diff --git a/test/Autofac.Integration.WebApi.Owin.Test/AutofacWebApiAppBuilderExtensionsFixture.cs b/test/Autofac.Integration.WebApi.Owin.Test/AutofacWebApiAppBuilderExtensionsFixture.cs index 1d0ca21..5cf3275 100644 --- a/test/Autofac.Integration.WebApi.Owin.Test/AutofacWebApiAppBuilderExtensionsFixture.cs +++ b/test/Autofac.Integration.WebApi.Owin.Test/AutofacWebApiAppBuilderExtensionsFixture.cs @@ -16,7 +16,7 @@ public void UseAutofacWebApiAddsDelegatingHandler() app.UseAutofacWebApi(configuration); - Assert.Equal(1, configuration.MessageHandlers.OfType().Count()); + Assert.Single(configuration.MessageHandlers.OfType()); } [Fact] @@ -28,7 +28,7 @@ public void UseAutofacWebApiWillOnlyAddDelegatingHandlerOnce() app.UseAutofacWebApi(configuration); app.UseAutofacWebApi(configuration); - Assert.Equal(1, configuration.MessageHandlers.OfType().Count()); + Assert.Single(configuration.MessageHandlers.OfType()); } } -} \ No newline at end of file +} From 15449d9ed6e5512903c3522439a88686a3855408 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Mon, 5 Oct 2020 15:14:52 -0700 Subject: [PATCH 08/11] Resolve #10 - Switch System.Net.Http to NuGet to fix runtime assembly location issues. --- .../Autofac.Integration.WebApi.Owin.csproj | 4 ++-- .../App.config | 19 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 test/Autofac.Integration.WebApi.Owin.Test/App.config diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj index f2ff3b6..cc2510a 100644 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj +++ b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj @@ -37,8 +37,7 @@ - - + All @@ -52,5 +51,6 @@ All + \ No newline at end of file diff --git a/test/Autofac.Integration.WebApi.Owin.Test/App.config b/test/Autofac.Integration.WebApi.Owin.Test/App.config deleted file mode 100644 index 250332c..0000000 --- a/test/Autofac.Integration.WebApi.Owin.Test/App.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 79fc5a30e8f987e8703fdd4774da2b4cc611cf52 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Mon, 5 Oct 2020 15:16:33 -0700 Subject: [PATCH 09/11] Added stylecop.json; fixed .gitignore. --- .gitignore | 134 ++++++++++++++++++-------------------------- build/stylecop.json | 14 +++++ 2 files changed, 68 insertions(+), 80 deletions(-) create mode 100644 build/stylecop.json diff --git a/.gitignore b/.gitignore index 1f602a7..78f36f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,49 +1,41 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +# Project specific files +artifacts/ +BenchmarkDotNet.Artifacts/ + # User-specific files *.suo *.user -*.docstates -*.cache -*.userprefs -project.lock.json -.vs/ -.cr/ -[Ii]ndex.dat -[Ss]torage.dat +*.sln.docstates +*.ide +Index.dat +Storage.dat # Build results [Dd]ebug/ -[Dd]ebugPublic/ [Rr]elease/ -[Rr]eleases/ x64/ -x86/ -bld/ [Bb]in/ [Oo]bj/ -[Aa]rtifacts/ -# Roslyn cache directories -*.ide/ +# Visual Studio 2015 cache/options directory +.dotnet/ +.vs/ +.cr/ + +# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets +!packages/*/build/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* - -#NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c +*.TestResults.xml +results/ *_i.c *_p.c -*_i.h *.ilk *.meta *.obj @@ -63,16 +55,12 @@ dlldata.c *.vssscc .builds *.pidb -*.svclog +*.log *.scc -# Chutzpah Test files -_Chutzpah* - # Visual C++ cache files ipch/ *.aps -*.ipch *.ncb *.opensdf *.sdf @@ -83,19 +71,12 @@ ipch/ *.vsp *.vspx -# TFS 2012 Local Workspace -$tf/ - # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding addin-in -.JustCode # TeamCity is a build add-in _TeamCity* @@ -103,17 +84,14 @@ _TeamCity* # DotCover is a Code Coverage Tool *.dotCover +# Coverage +coverage.* +codecov.sh +coverage/ + # NCrunch -_NCrunch_* +*.ncrunch* .*crunch*.local.xml -*.ncrunchsolution - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ # Installshield output folder [Ee]xpress/ @@ -133,29 +111,14 @@ publish/ # Publish Web Output *.[Pp]ublish.xml -*.azurePubxml -[Pp]ublish[Pp]rofiles/ -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted *.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Don't check in NuGet proper -.nuget/ -nuget.exe -# If using the old MSBuild-Integrated Package Restore, uncomment this: -#!**/packages/repositories.config -# Local filesystem/test NuGet -local-nuget/ + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +packages/ # Windows Azure Build Output -csx/ +csx *.build.csdef # Windows Store app package directory @@ -166,36 +129,47 @@ sql/ *.Cache ClientBin/ [Ss]tyle[Cc]op.* +!stylecop.json ~$* *~ *.dbmdl -*.dbproj.schemaview *.pfx *.publishsettings node_modules/ +bower_components/ +wwwroot/ +project.lock.json # RIA/Silverlight projects Generated_Code/ -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files -*.mdf -*.ldf +App_Data/*.mdf +App_Data/*.ldf + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings +# Recycle Bin used on file shares +$RECYCLE.BIN/ -# Microsoft Fakes -FakesAssemblies/ +# Mac crap +.DS_Store -# Mac OS -*DS_Store \ No newline at end of file +# JetBrains Rider +.idea diff --git a/build/stylecop.json b/build/stylecop.json new file mode 100644 index 0000000..8f5c703 --- /dev/null +++ b/build/stylecop.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "documentationRules": { + "companyName": "Autofac Project", + "copyrightText": "Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} License. See {licenseFile} in the project root for license information.", + "variables": { + "licenseFile": "LICENSE", + "licenseName": "MIT" + }, + "xmlHeader": false + } + } +} From 51d6624efaac9b211485f5d047020318c80d9991 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Mon, 5 Oct 2020 15:20:39 -0700 Subject: [PATCH 10/11] Fixed package publishing. --- appveyor.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7e36a41..339b511 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,5 @@ +image: Visual Studio 2019 + version: 6.0.0.{build} dotnet_csproj: @@ -7,8 +9,6 @@ dotnet_csproj: configuration: Release -image: Visual Studio 2019 - environment: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true NUGET_XMLDOC_MODE: skip @@ -23,11 +23,16 @@ clone_depth: 1 test: off build_script: -- ps: .\build.ps1 + - ps: .\build.ps1 + +artifacts: + - path: artifacts\packages\**\*.nupkg + name: MyGet deploy: - provider: NuGet - server: https://www.myget.org/F/autofac/ + server: https://www.myget.org/F/autofac/api/v2/package api_key: secure: rCUEY75fXN0wxtMy6QL4jCrLdaYbxIBzIXWeN+wEu/XDpyqimzreOc5AH5jMd5ah - symbol_server: https://nuget.symbolsource.org/MyGet/autofac + skip_symbols: false + symbol_server: https://www.myget.org/F/autofac/symbols/api/v2/package From 5c00538d2508e1f5be785a690c64beeaf2f58c14 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Mon, 5 Oct 2020 15:24:52 -0700 Subject: [PATCH 11/11] Corrected package ID. --- .../Autofac.Integration.WebApi.Owin.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj index cc2510a..32cf521 100644 --- a/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj +++ b/src/Autofac.Integration.WebApi.Owin/Autofac.Integration.WebApi.Owin.csproj @@ -11,7 +11,9 @@ icon.png https://autofac.org MIT - Release notes are at https://github.com/autofac/Autofac.WebApi.Owin/releases + Release notes are at https://github.com/autofac/Autofac.WebApi.Owin/releases + Autofac.WebApi2.Owin + Autofac.Integration.WebApi.Owin Autofac Autofac Contributors Autofac