From 614fcb49de1641729fd4247f41bc09a856a05e8a Mon Sep 17 00:00:00 2001 From: alsami Date: Thu, 23 Jul 2020 20:05:59 +0200 Subject: [PATCH 1/9] breaking: drop support for net461 --- Autofac.Multitenant.sln | 17 ++++ CONTRIBUTING.md | 88 ------------------- ISSUE_TEMPLATE.md | 11 --- global.json | 3 +- .../Autofac.Multitenant.csproj | 9 +- ...Autofac.Multitenant.AspNetCore.Test.csproj | 8 +- .../Autofac.Multitenant.Test.csproj | 6 +- 7 files changed, 29 insertions(+), 113 deletions(-) delete mode 100644 CONTRIBUTING.md delete mode 100644 ISSUE_TEMPLATE.md diff --git a/Autofac.Multitenant.sln b/Autofac.Multitenant.sln index 77d27ab..ac51cf8 100644 --- a/Autofac.Multitenant.sln +++ b/Autofac.Multitenant.sln @@ -13,6 +13,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Autofac.Multitenant.Test", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Autofac.Multitenant.AspNetCore.Test", "test\Autofac.Multitenant.AspNetCore.Test\Autofac.Multitenant.AspNetCore.Test.csproj", "{41D7953E-F018-455A-A669-4E02803800D0}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{C52CD612-DF58-4C64-BBF3-194BB3F92B1F}" +ProjectSection(SolutionItems) = preProject + build\CodeAnalysisDictionary.xml = build\CodeAnalysisDictionary.xml + build\Autofac.Build.psm1 = build\Autofac.Build.psm1 + build\Autofac.Build.psd1 = build\Autofac.Build.psd1 + build\Analyzers.ruleset = build\Analyzers.ruleset +EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{815BE18D-02C4-43E5-8DBF-ECDFA838C39E}" +ProjectSection(SolutionItems) = preProject + global.json = global.json + NuGet.Config = NuGet.Config + build.ps1 = build.ps1 + README.md = README.md + appveyor.yml = appveyor.yml +EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 51d0f0f..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Contributor Guide - -Contributions to Autofac, whether new features or bug fixes, are deeply appreciated and benefit the whole user community. - -The following guidelines help ensure the smooth running of the project, and keep a consistent standard across the codebase. They are guidelines only - should you feel a need to deviate from them it is probably for a good reason - but please adhere to them as closely as possible. - -If you'd like to contribute code or documentation to Autofac, we welcome pull requests. [Questions and suggestions are welcome on the newsgroup.](https://groups.google.com/forum/#!forum/autofac>). - -**Your contributions must be your own work and licensed under the same terms as Autofac.** - -## Process - -**When working through contributions, please file issues and submit pull requests in the repository containing the code in question.** For example, if the issue is with the Autofac MVC integration, file it in that repo rather than the core Autofac repo. - -- **File an issue.** Either suggest a feature or note a defect. If it's a feature, explain the challenge you're facing and how you think the feature should work. If it's a defect, include a description and reproduction (ideally one or more failing unit tests). -- **Design discussion.** For new features, some discussion on the issue will take place to determine if it's something that should be included with Autofac or be a user-supplied extension. For defects, discussion may happen around whether the issue is truly a defect or if the behavior is correct. -- **Pull request.** Create [a pull request](https://help.github.com/articles/using-pull-requests/) on the `develop` branch of the repository to submit changes to the code based on the information in the issue. Pull requests need to pass the CI build and follow coding standards. See below for more on coding standards in use with Autofac. Note all pull requests should include accompanying unit tests to verify the work. -- **Code review.** Some iteration may take place requiring updates to the pull request (e.g., to fix a typo or add error handling). -- **Pull request acceptance.** The pull request will be accepted into the `develop` branch and pushed to `master` with the next release. - -## License - -By contributing to Autofac, you assert that: - -1. The contribution is your own original work. -2. You have the right to assign the *copyright* for the work (it is not owned by your employer, or you have been given copyright assignment in writing). -3. You license it under the terms applied to the rest of the Autofac project. - -## Coding - -### Workflow - -Autofac and the associated integration libraries follow the [Gitflow workflow process](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow/) for handling releases. This means active development is done on the `develop` branch and we push to `master` when it's release time. **If you're creating a pull request or contribution, please do it on the `develop` branch.** We can then build, push to MyGet for testing, and release to NuGet when everything's verified. - -### Developer Environment - -- Visual Studio 2017 (with latest patches/updates). -- PowerShell 4+ - -### Dependencies - -The core Autofac assemblies depend _only_ on the .NET Base Class Libraries (BCL). `Autofac.dll` proper is a Portable Class Library so only depends on a subset of that BCL functionality. This is a conscious decision to keep the project lightweight and easier to maintain. - -For core integration assemblies (`Autofac.Integration.*`) the latest version of Autofac relies on the latest version of the integration target. For example, `Autofac.Integration.Mvc` always relies on the latest ASP.NET MVC libraries. This also helps keep the project easier to maintain. - -The `Autofac.Extras` features include assemblies that depend on other Open Source (OSS) libraries. It is important when including new dependencies that: - -- The project can be built straight out of Git (no additional installation needs to take place on the developer's machine). This means NuGet package references and/or checking in dependencies. -- Any third-party libraries have licenses compatible with Autofac's (the GPL and licenses like it are incompatible - please ask on the discussion forum if you're unsure). - -Unit tests are written in XUnit. - -### Build / Test - -Project codelines with scripted builds generally have a `build.ps1` script. This Powershell script will build, package, and execute tests. - -Some project codelines rely on convention-based builds so do not have a specific script. In these cases you will not see a `.ps1` or `.proj` file to execute. In these cases... - -- The build is executed by running it in Visual Studio or by executing `msbuild Solution.sln` on the solution in the codeline root. -- Unit tests can be run from the Visual Studio test explorer or by manually executing the command-line unit test runner from the `packages` folder against the built unit test assembly. - -### Code Documentation - -It is *strongly* encouraged that you update the Autofac documentation when making changes. If your changes impact existing features, the documentation may be updated regardless of whether a binary distribution has been made that includes the changes. [This can also be done through pull request.](https://github.com/autofac/Documentation) - -You should also include XML API comments in the code. These are used to generate API documentation as well as for IntelliSense. - -**The Golden Rule of Documentation: Write the documentation you'd want to read.** Every developer has seen self explanatory docs and wondered why there wasn't more information. (Parameter: "index." Documentation: "The index.") Please write the documentation you'd want to read if you were a developer first trying to understand how to make use of a feature. - -### Coding Standards - -Normal .NET coding guidelines apply. See the [Framework Design Guidelines](https://msdn.microsoft.com/en-us/library/ms229042.aspx>) for suggestions. If you have access to ReSharper, code should be 'green' - that is, have no ReSharper warnings or errors with the default settings. - -Autofac source code uses four spaces for indents (rather than tabs). - -[If you have the EditorConfig add-in for your editor of choice (Visual Studio, Sublime Text, etc.)](https://editorconfig.org/), there are `.editorconfig` settings in the various repositories to help make your life easier. - -## Autofac.Extras - -Autofac.Extras are companion libraries that get distributed alongside the main Autofac distribution. The Extras are distinguished by: - -- Experimental features -- Integrations with other Open Source projects -- Alternatives to the 'typical' way of doing something in the core (e.g. a different configuration syntax) - -In many cases, Autofac.Extras is a way of testing alternatives and getting visibility for new ideas that could eventually end up in the core. - -If your contribution is accepted to Autofac.Extras it is unlikely that the rest of the project team will have the knowledge to maintain it, so please expect to have bug reports assigned to you for the area (which you may subsequently reassign if you're unable to action them). diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index adc6bf7..0000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,11 +0,0 @@ -Try StackOverflow! If you have a _usage question_ ("How do I...?" "Others have this working but I can't get it...") please try [StackOverflow](https://stackoverflow.com) and tag your question `autofac`. We, along with a great community, monitor those questions. - -**Have you [read the docs?](https://autofac.readthedocs.io/)** - -**This repo is for Autofac.Multitenant only.** If you are encountering issues with another package (MVC, Web API, etc.) or core Autofac, please file it in the appropriate repo. Thanks! - -**When filing an issue, please include:** - -- Assembly version information for _all_ project dependencies (packages.config, project.json) -- The stack trace and message of any exception(s) encountered. -- If possible, a reproduction of the issue (ideally in a unit test form). diff --git a/global.json b/global.json index 79422f0..7ff558c 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,6 @@ { "sdk": { - "version": "3.0.100" + "version": "3.1.202", + "rollForward": "latestFeature" } } diff --git a/src/Autofac.Multitenant/Autofac.Multitenant.csproj b/src/Autofac.Multitenant/Autofac.Multitenant.csproj index 836f97d..9e9dc2e 100644 --- a/src/Autofac.Multitenant/Autofac.Multitenant.csproj +++ b/src/Autofac.Multitenant/Autofac.Multitenant.csproj @@ -3,7 +3,7 @@ Autofac extension for multitenant application support. 5.0.1 - net461;netstandard2.0;netstandard2.1; + netstandard2.0;netstandard2.1; true true Autofac.Multitenant @@ -32,12 +32,9 @@ Autofac - - - - - + + All diff --git a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj index c09e515..514cbec 100644 --- a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj +++ b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2;netcoreapp3.0;net461 + netcoreapp2.1;netcoreapp3.0;netcoreapp3.1; $(NoWarn);CS1591;SA1602;SA1611 true Autofac.Multitenant.AspNetCore.Test @@ -21,14 +21,14 @@ - - + + All - + diff --git a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj index 962fdd7..e2b6e3d 100644 --- a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj +++ b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2;netcoreapp3.0;net461 + netcoreapp2.1;netcoreapp3.0;netcoreapp3.1; $(NoWarn);CS1591;SA1602;SA1611 true Autofac.Multitenant.Test @@ -21,8 +21,8 @@ - - + + All From dd9d6d6961b2126e74492f22caa53fb13af46cc9 Mon Sep 17 00:00:00 2001 From: alsami Date: Fri, 24 Jul 2020 09:28:34 +0200 Subject: [PATCH 2/9] chore: apply PR recommendations --- src/Autofac.Multitenant/Autofac.Multitenant.csproj | 5 ++++- .../Autofac.Multitenant.AspNetCore.Test.csproj | 2 +- .../Autofac.Multitenant.Test.csproj | 6 +----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Autofac.Multitenant/Autofac.Multitenant.csproj b/src/Autofac.Multitenant/Autofac.Multitenant.csproj index 9e9dc2e..65c4428 100644 --- a/src/Autofac.Multitenant/Autofac.Multitenant.csproj +++ b/src/Autofac.Multitenant/Autofac.Multitenant.csproj @@ -31,10 +31,13 @@ Autofac Autofac + + + + - All diff --git a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj index 514cbec..d090872 100644 --- a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj +++ b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1;netcoreapp3.0;netcoreapp3.1; + netcoreapp3.1; $(NoWarn);CS1591;SA1602;SA1611 true Autofac.Multitenant.AspNetCore.Test diff --git a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj index e2b6e3d..3bd770b 100644 --- a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj +++ b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1;netcoreapp3.0;netcoreapp3.1; + netcoreapp3.1 $(NoWarn);CS1591;SA1602;SA1611 true Autofac.Multitenant.Test @@ -33,8 +33,4 @@ - - - - From eea8d459911512a82683a7e1b717906c4205a25a Mon Sep 17 00:00:00 2001 From: alsami Date: Fri, 24 Jul 2020 10:04:10 +0200 Subject: [PATCH 3/9] feat: build using ubuntu and add code-coverage --- .gitignore | 345 ++++++------ Autofac.Multitenant.sln | 1 + README.md | 26 +- appveyor.yml | 73 +-- build.ps1 | 104 ++-- build/Autofac.Build.psm1 | 514 +++++++++--------- build/icon.png | Bin 0 -> 7062 bytes codecov.yml | 3 + .../Autofac.Multitenant.csproj | 5 +- ...Autofac.Multitenant.AspNetCore.Test.csproj | 4 +- .../Autofac.Multitenant.Test.csproj | 2 + 11 files changed, 562 insertions(+), 515 deletions(-) create mode 100644 build/icon.png create mode 100644 codecov.yml diff --git a/.gitignore b/.gitignore index 5895333..ab68421 100644 --- a/.gitignore +++ b/.gitignore @@ -1,170 +1,175 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# Project specific files -artifacts/ - -# User-specific files -*.suo -*.user -*.sln.docstates -*.ide -Index.dat -Storage.dat - -# Build results -[Dd]ebug/ -[Rr]elease/ -x64/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.dotnet/ -.vs/ -.vscode/ -.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.* -*.TestResults.xml -results/ - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.pubxml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -!stylecop.json -~$* -*~ -*.dbmdl -*.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 ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -# ========================= -# Windows detritus -# ========================= - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac crap -.DS_Store - -# JetBrains Rider -.idea +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# Project specific files +artifacts/ + +# User-specific files +*.suo +*.user +*.sln.docstates +*.ide +Index.dat +Storage.dat + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.dotnet/ +.vs/ +.vscode/ +.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.* +*.TestResults.xml +results/ + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Coverage +coverage.* +codecov.sh +coverage/ + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +!stylecop.json +~$* +*~ +*.dbmdl +*.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 ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + +# JetBrains Rider +.idea diff --git a/Autofac.Multitenant.sln b/Autofac.Multitenant.sln index ac51cf8..482e85b 100644 --- a/Autofac.Multitenant.sln +++ b/Autofac.Multitenant.sln @@ -28,6 +28,7 @@ ProjectSection(SolutionItems) = preProject build.ps1 = build.ps1 README.md = README.md appveyor.yml = appveyor.yml + codecov.yml = codecov.yml EndProjectSection EndProject Global diff --git a/README.md b/README.md index 21a2dc3..9b772b3 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# Autofac.Multitenant - -Multitenant application support for [Autofac IoC](https://github.com/autofac/Autofac). - -[![Build status](https://ci.appveyor.com/api/projects/status/9120t73i97ywdoav?svg=true)](https://ci.appveyor.com/project/Autofac/autofac-multitenant) - -Please file issues and pull requests for this package in this repository rather than in the Autofac core repo. - -**BREAKING CHANGE**: As of v4.0.0, the `Autofac.Extras.Multitenant` package is `Autofac.Multitenant`. - -- [Documentation](https://autofac.readthedocs.io/en/latest/advanced/multitenant.html) -- [NuGet](https://www.nuget.org/packages/Autofac.Multitenant) -- [Contributing](https://autofac.readthedocs.io/en/latest/contributors.html) +# Autofac.Multitenant + +Multitenant application support for [Autofac IoC](https://github.com/autofac/Autofac). + +[![Build status](https://ci.appveyor.com/api/projects/status/9120t73i97ywdoav?svg=true)](https://ci.appveyor.com/project/Autofac/autofac-multitenant) [![codecov](https://codecov.io/gh/Autofac/Autofac.Multitenant/branch/develop/graph/badge.svg)](https://codecov.io/gh/Autofac/Autofac.Multitenant) + +Please file issues and pull requests for this package in this repository rather than in the Autofac core repo. + +**BREAKING CHANGE**: As of v4.0.0, the `Autofac.Extras.Multitenant` package is `Autofac.Multitenant`. + +- [Documentation](https://autofac.readthedocs.io/en/latest/advanced/multitenant.html) +- [NuGet](https://www.nuget.org/packages/Autofac.Multitenant) +- [Contributing](https://autofac.readthedocs.io/en/latest/contributors.html) diff --git a/appveyor.yml b/appveyor.yml index d347d0a..f0e95bd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,34 +1,39 @@ -version: 5.0.1.{build} - -configuration: Release - -os: Visual Studio 2019 - -environment: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - NUGET_XMLDOC_MODE: skip - -skip_tags: true - -nuget: - disable_publish_on_pr: true - -clone_depth: 1 - -test: off - -build_script: -- ps: .\build.ps1 - -artifacts: -- path: artifacts\packages\**\*.nupkg - name: MyGet - -deploy: -- provider: NuGet - server: https://www.myget.org/F/autofac/api/v2/package - api_key: - secure: rCUEY75fXN0wxtMy6QL4jCrLdaYbxIBzIXWeN+wEu/XDpyqimzreOc5AH5jMd5ah - skip_symbols: true - symbol_server: https://www.myget.org/F/autofac/symbols/api/v2/package - artifact: MyGet +image: Ubuntu + +version: '6.0.0.{build}' + +dotnet_csproj: + version_prefix: '6.0.0' + patch: true + file: 'src\**\*.csproj' + +configuration: Release + +environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + NUGET_XMLDOC_MODE: skip + +skip_tags: true + +nuget: + disable_publish_on_pr: true + +clone_depth: 1 + +test: off + +build_script: + - pwsh: .\build.ps1 + +artifacts: +- path: artifacts\packages\**\*.nupkg + name: MyGet + +deploy: +- provider: NuGet + server: https://www.myget.org/F/autofac/api/v2/package + api_key: + secure: rCUEY75fXN0wxtMy6QL4jCrLdaYbxIBzIXWeN+wEu/XDpyqimzreOc5AH5jMd5ah + skip_symbols: true + symbol_server: https://www.myget.org/F/autofac/symbols/api/v2/package + artifact: MyGet diff --git a/build.ps1 b/build.ps1 index 1d154bd..b1b4569 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,46 +1,58 @@ -######################## -# 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 +######################## +# THE BUILD! +######################## + +Push-Location $PSScriptRoot +try { + 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) }[$NULL -ne $env:APPVEYOR_REPO_BRANCH]; + $revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$NULL -ne $env:APPVEYOR_BUILD_NUMBER]; + $versionSuffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)).Replace('/', '-'))-$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 + + if ($env:CI -eq "true") { + # Generate Coverage Report + Write-Message "Generating Codecov Report" + Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh + & bash codecov.sh -f "coverage.info" + } + + # Finished + Write-Message "Build finished" + Pop-Location +} +finally { + Pop-Location +} diff --git a/build/Autofac.Build.psm1 b/build/Autofac.Build.psm1 index 9cf9c6a..f181ce1 100644 --- a/build/Autofac.Build.psm1 +++ b/build/Autofac.Build.psm1 @@ -1,250 +1,264 @@ -# 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 ((Get-Command "dotnet.exe" -ErrorAction SilentlyContinue) -ne $null) - { - $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 - } - } - } -} +# 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 ((Get-Command "dotnet.exe" -ErrorAction SilentlyContinue) -ne $null) + { + $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 ($IsWindows) { + if (!(Test-Path ./.dotnet/dotnet-install.ps1)) { + Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./.dotnet/dotnet-install.ps1" + } + + & ./.dotnet/dotnet-install.ps1 -InstallDir "$installDir" -Version $Version + $env:PATH = "$installDir;$env:PATH" + } else { + if (!(Test-Path ./.dotnet/dotnet-install.sh)) { + Invoke-WebRequest "https://dot.net/v1/dotnet-install.sh" -OutFile "./.dotnet/dotnet-install.sh" + } + + & bash ./.dotnet/dotnet-install.sh --install-dir "$installDir" --version $Version + $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 ` + /p:CollectCoverage=true ` + /p:CoverletOutput="..\..\" ` + /p:MergeWith="..\..\coverage.json" ` + /p:CoverletOutputFormat="json%2clcov" ` + /p:ExcludeByAttribute=CompilerGeneratedAttribute ` + /p:ExcludeByAttribute=GeneratedCodeAttribute + + 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/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&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RX7%u>iZnC^;$h}!Jxam%AoHc zF(+bqq1<)Cv&Xrze%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 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..79311a6 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +codecov: + branch: develop + require_ci_to_pass: yes diff --git a/src/Autofac.Multitenant/Autofac.Multitenant.csproj b/src/Autofac.Multitenant/Autofac.Multitenant.csproj index 65c4428..1dc92d3 100644 --- a/src/Autofac.Multitenant/Autofac.Multitenant.csproj +++ b/src/Autofac.Multitenant/Autofac.Multitenant.csproj @@ -13,7 +13,6 @@ Autofac.Multitenant autofac;di;ioc;dependencyinjection Release notes are at https://github.com/autofac/Autofac.Multitenant/releases - https://cloud.githubusercontent.com/assets/1156571/13684110/16b8f152-e6bf-11e5-84ae-22c66c6d351a.png https://autofac.org https://opensource.org/licenses/mit-license.php git @@ -31,6 +30,10 @@ Autofac Autofac + + + + diff --git a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj index d090872..9e4c444 100644 --- a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj +++ b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1; + netcoreapp3.1 $(NoWarn);CS1591;SA1602;SA1611 true Autofac.Multitenant.AspNetCore.Test @@ -29,6 +29,8 @@ + + diff --git a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj index 3bd770b..4331289 100644 --- a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj +++ b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj @@ -27,6 +27,8 @@ All + + From 0b2796a961df32a6bea1733d8665889787e08f4c Mon Sep 17 00:00:00 2001 From: alsami Date: Sat, 25 Jul 2020 07:59:40 +0200 Subject: [PATCH 4/9] chore: apply PR recommendations --- .gitignore | 1 - appveyor.yml | 4 ++-- build/Autofac.Build.psd1 | 28 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index ab68421..cfaad24 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ x64/ # Visual Studio 2015 cache/options directory .dotnet/ .vs/ -.vscode/ .cr/ # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets diff --git a/appveyor.yml b/appveyor.yml index f0e95bd..8f6507f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,9 @@ image: Ubuntu -version: '6.0.0.{build}' +version: '5.0.0.{build}' dotnet_csproj: - version_prefix: '6.0.0' + version_prefix: '5.0.0' patch: true file: 'src\**\*.csproj' diff --git a/build/Autofac.Build.psd1 b/build/Autofac.Build.psd1 index 5d93715..6e7a322 100644 --- a/build/Autofac.Build.psd1 +++ b/build/Autofac.Build.psd1 @@ -1,15 +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 = '' +@{ + RootModule = '.\Autofac.Build.psm1' + ModuleVersion = '0.3.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 From 30221f9b9925f71e101701bcf32e16b102c48d4d Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Sat, 25 Jul 2020 12:34:36 -0700 Subject: [PATCH 5/9] Semver => 6.0.0 because we dropped net461 --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8f6507f..f0e95bd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,9 @@ image: Ubuntu -version: '5.0.0.{build}' +version: '6.0.0.{build}' dotnet_csproj: - version_prefix: '5.0.0' + version_prefix: '6.0.0' patch: true file: 'src\**\*.csproj' From d877186e0d2192d99419fef7d4b1a8074614d168 Mon Sep 17 00:00:00 2001 From: alsami Date: Wed, 2 Sep 2020 14:44:15 +0200 Subject: [PATCH 6/9] feat: upgrade Autofac to latest develop version and implement missing member --- codecov.yml | 5 +++++ global.json | 2 +- src/Autofac.Multitenant/Autofac.Multitenant.csproj | 4 ++-- src/Autofac.Multitenant/MultitenantContainer.cs | 3 +++ .../MultitenantContainerFixture.cs | 13 +++++++++++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/codecov.yml b/codecov.yml index 79311a6..21faf6d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,8 @@ codecov: branch: develop require_ci_to_pass: yes +coverage: + status: + project: + default: + threshold: 1% \ No newline at end of file diff --git a/global.json b/global.json index 7ff558c..45bd89c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "3.1.202", + "version": "3.1.401", "rollForward": "latestFeature" } } diff --git a/src/Autofac.Multitenant/Autofac.Multitenant.csproj b/src/Autofac.Multitenant/Autofac.Multitenant.csproj index 1dc92d3..576061c 100644 --- a/src/Autofac.Multitenant/Autofac.Multitenant.csproj +++ b/src/Autofac.Multitenant/Autofac.Multitenant.csproj @@ -14,7 +14,7 @@ autofac;di;ioc;dependencyinjection Release notes are at https://github.com/autofac/Autofac.Multitenant/releases https://autofac.org - https://opensource.org/licenses/mit-license.php + MIT git https://github.com/autofac/Autofac.Multitenant false @@ -40,7 +40,7 @@ - + All diff --git a/src/Autofac.Multitenant/MultitenantContainer.cs b/src/Autofac.Multitenant/MultitenantContainer.cs index 2176e9f..7cc5a0a 100644 --- a/src/Autofac.Multitenant/MultitenantContainer.cs +++ b/src/Autofac.Multitenant/MultitenantContainer.cs @@ -689,5 +689,8 @@ protected override async ValueTask DisposeAsync(bool disposing) // Do not call the base, otherwise the standard Dispose will fire. } + + /// + public DiagnosticListener DiagnosticSource => this.ApplicationContainer.DiagnosticSource; } } diff --git a/test/Autofac.Multitenant.Test/MultitenantContainerFixture.cs b/test/Autofac.Multitenant.Test/MultitenantContainerFixture.cs index 0f351e8..cfe813d 100644 --- a/test/Autofac.Multitenant.Test/MultitenantContainerFixture.cs +++ b/test/Autofac.Multitenant.Test/MultitenantContainerFixture.cs @@ -732,5 +732,18 @@ public async Task MultitenantContainer_AsyncDispose() await mtc.DisposeAsync(); } + + [Fact] + public void MultitenantContainer_DiagnosticSourceNotNull() + { + var strategy = new StubTenantIdentificationStrategy() + { + TenantId = "tenant1", + }; + + var mtc = new MultitenantContainer(strategy, new ContainerBuilder().Build()); + + Assert.NotNull(mtc.DiagnosticSource); + } } } From b9d9162c80176ecc992561d7ebac8df311ceee7e Mon Sep 17 00:00:00 2001 From: Alex Meyer-Gleaves Date: Sat, 26 Sep 2020 18:29:11 +1000 Subject: [PATCH 7/9] Remove PublicSign condition and increase SDK version to 3.1.402 (#27) * Set .NET Core SDK to 3.1.402 * Remove PublicSign * Leave VersionPrefix at default --- global.json | 2 +- src/Autofac.Multitenant/Autofac.Multitenant.csproj | 6 +++--- .../Autofac.Multitenant.AspNetCore.Test.csproj | 1 - .../Autofac.Multitenant.Test.csproj | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/global.json b/global.json index 45bd89c..b4c7a8c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "3.1.401", + "version": "3.1.402", "rollForward": "latestFeature" } } diff --git a/src/Autofac.Multitenant/Autofac.Multitenant.csproj b/src/Autofac.Multitenant/Autofac.Multitenant.csproj index 576061c..226ac96 100644 --- a/src/Autofac.Multitenant/Autofac.Multitenant.csproj +++ b/src/Autofac.Multitenant/Autofac.Multitenant.csproj @@ -2,14 +2,14 @@ Autofac extension for multitenant application support. - 5.0.1 + + 0.0.1 netstandard2.0;netstandard2.1; true true Autofac.Multitenant ../../Autofac.snk true - true Autofac.Multitenant autofac;di;ioc;dependencyinjection Release notes are at https://github.com/autofac/Autofac.Multitenant/releases @@ -40,7 +40,7 @@ - + All diff --git a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj index 9e4c444..b3431d2 100644 --- a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj +++ b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj @@ -7,7 +7,6 @@ Autofac.Multitenant.AspNetCore.Test ../../Autofac.snk true - true Autofac.Multitenant.AspNetCore.Test true false diff --git a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj index 4331289..ba3b835 100644 --- a/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj +++ b/test/Autofac.Multitenant.Test/Autofac.Multitenant.Test.csproj @@ -7,7 +7,6 @@ Autofac.Multitenant.Test ../../Autofac.snk true - true Autofac.Multitenant.Test true false From c251f23f700820a77ead789160bdc605168d7579 Mon Sep 17 00:00:00 2001 From: alsami Date: Mon, 28 Sep 2020 20:51:51 +0200 Subject: [PATCH 8/9] chore: update to Autofac v6 stable --- src/Autofac.Multitenant/Autofac.Multitenant.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Autofac.Multitenant/Autofac.Multitenant.csproj b/src/Autofac.Multitenant/Autofac.Multitenant.csproj index 226ac96..bed5707 100644 --- a/src/Autofac.Multitenant/Autofac.Multitenant.csproj +++ b/src/Autofac.Multitenant/Autofac.Multitenant.csproj @@ -40,7 +40,7 @@ - + All From 93ea0ed6f60734394b9ffd98f643fb0dc2df51f0 Mon Sep 17 00:00:00 2001 From: alsami Date: Mon, 28 Sep 2020 22:35:38 +0200 Subject: [PATCH 9/9] chore: update Autofac.Extensions.DependencyInjection to latest stable --- .../Autofac.Multitenant.AspNetCore.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj index b3431d2..f1ecd76 100644 --- a/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj +++ b/test/Autofac.Multitenant.AspNetCore.Test/Autofac.Multitenant.AspNetCore.Test.csproj @@ -22,7 +22,7 @@ - + All