From ba16b0dba3c52c1da67dd346513005b8d49e3653 Mon Sep 17 00:00:00 2001 From: Xavier Tremblay Date: Fri, 6 Jan 2023 12:07:08 -0500 Subject: [PATCH] Mainstream the files in the solution to GSoft's library standard --- .editorconfig | 2 + .gitattributes | 1 + .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/bug_report.md | 32 ++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.md | 20 ++ .github/dependabot.yml | 11 ++ .github/workflows/ci.yml | 23 +-- .github/workflows/codeql.yml | 35 ++++ .github/workflows/publish.yml | 25 +++ .github/workflows/release.yml | 29 --- .gitignore | 7 +- Build.ps1 | 35 ++++ CONTRIBUTING.md | 3 + GitVersion.yml | 94 ++++++++++ README.md | 3 +- SECURITY.md | 3 + build.ps1 | 2 - build.sh | 1 - build/Build.csproj | 14 -- build/Program.cs | 175 ------------------ global.json | 7 + src/.editorconfig | 5 +- src/Directory.Build.props | 19 +- ...ns.Configuration.Substitution.Tests.csproj | 14 +- .../AssemblyProperties.cs | 8 - ...ChainedSubstitutedConfigurationProvider.cs | 5 +- ...tensions.Configuration.Substitution.csproj | 14 +- .../PublicAPI.Shipped.txt | 6 + .../PublicAPI.Unshipped.txt | 1 + .../RecursiveConfigurationKeyException.cs | 3 - 31 files changed, 329 insertions(+), 270 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml create mode 100644 Build.ps1 create mode 100644 CONTRIBUTING.md create mode 100644 GitVersion.yml create mode 100644 SECURITY.md delete mode 100644 build.ps1 delete mode 100644 build.sh delete mode 100644 build/Build.csproj delete mode 100644 build/Program.cs create mode 100644 global.json delete mode 100644 src/GSoft.Extensions.Configuration.Substitution/AssemblyProperties.cs create mode 100644 src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Shipped.txt create mode 100644 src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Unshipped.txt diff --git a/.editorconfig b/.editorconfig index fee44c5..bb9b55f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,5 @@ +root = true + [*] indent_style = space charset = utf-8 diff --git a/.gitattributes b/.gitattributes index 7a2a039..2aba43e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,4 +12,5 @@ *.yml text eol=lf *.yaml text eol=lf *.Dockerfile text eol=lf +Dockerfile text eol=lf LICENSE text eol=lf \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..3eaa631 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @gsoft-inc/tech-platform \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..ed92054 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + - OS: [e.g. Windows] + - Version: [e.g. 1.2.3] + - IDE: [e.g. Rider] + - etc. + +**Additional context** +Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..24473de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..473ecc8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: "nuget" + directory: "/src" + schedule: + interval: "weekly" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb10ad7..e982133 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,11 @@ -name: CI build +name: CI on: - push: - branches: - - master pull_request: - branches: - - master + branches: ["main", "master"] jobs: - build: + main: runs-on: ubuntu-latest steps: @@ -17,16 +13,9 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v2 + - uses: actions/setup-dotnet@v3 with: - dotnet-version: | - 3.1.x - 6.0.x + dotnet-version: "6.0.x" - - run: ./build.ps1 + - run: ./Build.ps1 shell: pwsh - - - uses: actions/upload-artifact@v3 - with: - name: packages - path: ./.output/**/* diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..b0c853d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,35 @@ +name: CodeQL + +on: + push: + branches: ["main", "master"] + pull_request: + branches: ["main", "master"] + schedule: + - cron: "22 6 * * 0" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: csharp + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:csharp" \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..05ef20d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,25 @@ +name: Publish + +on: + push: + branches: ["main", "master"] + tags: ["*.*.*"] + +jobs: + main: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: "6.0.x" + + - run: ./Build.ps1 + shell: pwsh + env: + NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} + NUGET_API_KEY: ${{ secrets.GSOFTINC_NUGET_API_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index ac3c88d..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: NuGet push - -on: - push: - tags: - - "*.*.*" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: actions/setup-dotnet@v2 - with: - dotnet-version: | - 3.1.x - 6.0.x - - - run: ./build.ps1 --target=push --nuget-api-key=${{ secrets.nuget_api_key }} --nuget-source=${{ secrets.nuget_source }} - shell: pwsh - - - uses: actions/upload-artifact@v3 - with: - name: packages - path: ./.output/**/* \ No newline at end of file diff --git a/.gitignore b/.gitignore index febdc5a..0ace0bb 100644 --- a/.gitignore +++ b/.gitignore @@ -375,7 +375,7 @@ FodyWeavers.xsd *.msm *.msp -# JetBrains Rider +# JetBrains IDEs .idea/ *.sln.iml @@ -386,6 +386,5 @@ ehthumbs.db Thumbs.db $RECYCLE.BIN/ -# Cake -build/tools/** -!build/tools/packages.config \ No newline at end of file +# Build output +/.output/ \ No newline at end of file diff --git a/Build.ps1 b/Build.ps1 new file mode 100644 index 0000000..83b05ee --- /dev/null +++ b/Build.ps1 @@ -0,0 +1,35 @@ +#Requires -Version 5.0 + +Begin { + $ErrorActionPreference = "stop" +} + +Process { + function Exec([scriptblock]$Command) { + & $Command + if ($LASTEXITCODE -ne 0) { + throw ("An error occurred while executing command: {0}" -f $Command) + } + } + + $workingDir = Join-Path $PSScriptRoot "src" + $outputDir = Join-Path $PSScriptRoot ".output" + $nupkgsPath = Join-Path $outputDir "*.nupkg" + + try { + Push-Location $workingDir + Remove-Item $outputDir -Force -Recurse -ErrorAction SilentlyContinue + + Exec { & dotnet clean -c Release } + Exec { & dotnet build -c Release } + Exec { & dotnet test -c Release --no-build -r "$outputDir" --no-restore -l "trx" -l "console;verbosity=detailed" } + Exec { & dotnet pack -c Release --no-build -o "$outputDir" } + + if (($null -ne $env:NUGET_SOURCE ) -and ($null -ne $env:NUGET_API_KEY)) { + Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY } + } + } + finally { + Pop-Location + } +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cf0be6f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing + +We do not accept external pull requests yet. \ No newline at end of file diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..7fb12de --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,94 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +assembly-informational-format: "{InformationalVersion}" +mode: ContinuousDelivery +increment: Inherit +continuous-delivery-fallback-tag: ci +tag-prefix: "[vV]" +major-version-bump-message: '\+semver:\s?(breaking|major)' +minor-version-bump-message: '\+semver:\s?(feature|minor)' +patch-version-bump-message: '\+semver:\s?(fix|patch)' +no-bump-message: '\+semver:\s?(none|skip)' +legacy-semver-padding: 4 +build-metadata-padding: 4 +commits-since-version-source-padding: 4 +tag-pre-release-weight: 60000 +commit-message-incrementing: Enabled +update-build-number: true + +branches: + main: + regex: ^(master|main)$ + mode: ContinuousDeployment + tag: preview + increment: Patch + prevent-increment-of-merged-branch-version: true + track-merge-target: false + source-branches: ["develop", "release"] + tracks-release-branches: false + is-release-branch: false + is-mainline: true + pre-release-weight: 55000 + develop: + regex: ^dev(elop)?(ment)?$ + mode: ContinuousDeployment + tag: alpha + increment: Minor + prevent-increment-of-merged-branch-version: false + track-merge-target: true + source-branches: [] + tracks-release-branches: true + is-release-branch: false + is-mainline: false + pre-release-weight: 0 + release: + regex: ^releases?[/-] + mode: ContinuousDelivery + tag: beta + increment: None + prevent-increment-of-merged-branch-version: true + track-merge-target: false + source-branches: ["develop", "main", "support", "release"] + tracks-release-branches: false + is-release-branch: true + is-mainline: false + pre-release-weight: 30000 + feature: + regex: ^features?[/-] + mode: ContinuousDelivery + tag: useBranchName + increment: Inherit + prevent-increment-of-merged-branch-version: false + track-merge-target: false + source-branches: + ["develop", "main", "release", "feature", "support", "hotfix"] + tracks-release-branches: false + is-release-branch: false + is-mainline: false + pre-release-weight: 30000 + pull-request: + regex: ^(pull|pull\-requests|pr)[/-] + mode: ContinuousDelivery + tag: PullRequest + increment: Inherit + prevent-increment-of-merged-branch-version: false + tag-number-pattern: '[/-](?\d+)[-/]' + track-merge-target: false + source-branches: + ["develop", "main", "release", "feature", "support", "hotfix"] + tracks-release-branches: false + is-release-branch: false + is-mainline: false + pre-release-weight: 30000 + hotfix: + regex: ^hotfix(es)?[/-] + mode: ContinuousDelivery + tag: beta + increment: Patch + prevent-increment-of-merged-branch-version: false + track-merge-target: false + source-branches: ["develop", "main", "support"] + tracks-release-branches: false + is-release-branch: false + is-mainline: false + pre-release-weight: 30000 \ No newline at end of file diff --git a/README.md b/README.md index 7d3ed8b..c243b62 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ This package adds variable substitution configuration provider implementation for [Microsoft.Extensions.Configuration](https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration). [![nuget](https://img.shields.io/nuget/v/GSoft.Extensions.Configuration.Substitution.svg?logo=nuget)](https://www.nuget.org/packages/GSoft.Extensions.Configuration.Substitution/) -[![build](https://img.shields.io/github/workflow/status/gsoft-inc/gsoft-extensions-configuration-substitution/CI%20build?logo=github)](https://github.com/gsoft-inc/gsoft-extensions-configuration-substitution/actions/workflows/ci.yml) - +[![build](https://img.shields.io/github/actions/workflow/status/gsoft-inc/gsoft-extensions-configuration-substitution/publish.yml?logo=github)](https://github.com/gsoft-inc/gsoft-extensions-configuration-substitution/actions/workflows/publish.yml) ## Getting started diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..9d271f9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,3 @@ +# Security Policy + +If you'd like to report a vulnerability, please open a [GitHub issue](https://github.com/gsoft-inc/gsoft-extensions-configuration-substitution/issues). diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index a707719..0000000 --- a/build.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -dotnet run --project build/Build.csproj -- $args -exit $LASTEXITCODE; \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100644 index dfd6b85..0000000 --- a/build.sh +++ /dev/null @@ -1 +0,0 @@ -dotnet run --project ./build/Build.csproj -- "$@" diff --git a/build/Build.csproj b/build/Build.csproj deleted file mode 100644 index c66d32e..0000000 --- a/build/Build.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - Exe - net6.0 - $(MSBuildProjectDirectory) - True - enable - 10 - - - - - - \ No newline at end of file diff --git a/build/Program.cs b/build/Program.cs deleted file mode 100644 index 51520a5..0000000 --- a/build/Program.cs +++ /dev/null @@ -1,175 +0,0 @@ -using System; -using System.IO; -using Cake.Common; -using Cake.Common.IO; -using Cake.Common.Tools.DotNet; -using Cake.Common.Tools.DotNet.Build; -using Cake.Common.Tools.DotNet.MSBuild; -using Cake.Common.Tools.DotNet.NuGet.Push; -using Cake.Common.Tools.DotNet.Pack; -using Cake.Common.Tools.DotNet.Restore; -using Cake.Common.Tools.DotNet.Test; -using Cake.Common.Tools.GitVersion; -using Cake.Core; -using Cake.Core.Diagnostics; -using Cake.Frosting; - -return new CakeHost() - .InstallTool(new Uri("dotnet:?package=GitVersion.Tool&version=5.10.1")) - .UseContext() - .Run(args); - -public static class Constants -{ - public const string Release = "Release"; - public const string ProjectName = "GSoft.Extensions.Configuration.Substitution"; - - public static readonly string SourceDirectoryPath = Path.Combine("..", "src"); - public static readonly string OutputDirectoryPath = Path.Combine("..", ".output"); - public static readonly string SolutionPath = Path.Combine(SourceDirectoryPath, ProjectName + ".sln"); - public static readonly string MainProjectPath = Path.Combine(SourceDirectoryPath, ProjectName, ProjectName + ".csproj"); -} - -public class BuildContext : FrostingContext -{ - public BuildContext(ICakeContext context) : base(context) - { - this.NugetApiKey = context.Argument("nuget-api-key", string.Empty); - this.NugetSource = context.Argument("nuget-source", string.Empty); - } - - public DotNetMSBuildSettings MSBuildSettings { get; } = new DotNetMSBuildSettings(); - - public string NugetApiKey { get; } - - public string NugetSource { get; } - - public void AddMSBuildSetting(string name, string value, bool log = false) - { - if (log) - { - this.Log.Information(name + ": " + value); - } - - if (!string.IsNullOrWhiteSpace(value)) - { - this.MSBuildSettings.Properties[name] = new[] { value }; - } - } -} - -[TaskName("Clean")] -public sealed class CleanTask : FrostingTask -{ - public override void Run(BuildContext context) - { - var objGlobPath = Path.Combine(Constants.SourceDirectoryPath, "*", "obj"); - var binGlobPath = Path.Combine(Constants.SourceDirectoryPath, "*", "bin"); - - context.CleanDirectories(Constants.OutputDirectoryPath); - context.CleanDirectories(objGlobPath); - context.CleanDirectories(binGlobPath); - } -} - -[TaskName("GitVersion")] -public sealed class GitVersionTask : FrostingTask -{ - public override void Run(BuildContext context) - { - var gitVersion = context.GitVersion(); - - context.AddMSBuildSetting("Version", gitVersion.NuGetVersion, log: true); - context.AddMSBuildSetting("VersionPrefix", gitVersion.MajorMinorPatch, log: true); - context.AddMSBuildSetting("VersionSuffix", gitVersion.PreReleaseTag, log: true); - context.AddMSBuildSetting("PackageVersion", gitVersion.FullSemVer, log: true); - context.AddMSBuildSetting("InformationalVersion", gitVersion.InformationalVersion, log: true); - context.AddMSBuildSetting("AssemblyVersion", gitVersion.AssemblySemVer, log: true); - context.AddMSBuildSetting("FileVersion", gitVersion.AssemblySemFileVer, log: true); - context.AddMSBuildSetting("RepositoryBranch", gitVersion.BranchName, log: true); - context.AddMSBuildSetting("RepositoryCommit", gitVersion.Sha, log: true); - } -} - -[TaskName("Restore")] -[IsDependentOn(typeof(CleanTask))] -[IsDependentOn(typeof(GitVersionTask))] -public sealed class RestoreTask : FrostingTask -{ - public override void Run(BuildContext context) => context.DotNetRestore(Constants.SolutionPath, new DotNetRestoreSettings - { - MSBuildSettings = context.MSBuildSettings, - }); -} - -[TaskName("Build")] -[IsDependentOn(typeof(RestoreTask))] -public sealed class BuildTask : FrostingTask -{ - public override void Run(BuildContext context) - { - context.AddMSBuildSetting("Deterministic", "true"); - context.AddMSBuildSetting("ContinuousIntegrationBuild", "true"); - - context.DotNetBuild(Constants.SolutionPath, new DotNetBuildSettings - { - Configuration = Constants.Release, - MSBuildSettings = context.MSBuildSettings, - NoRestore = true, - NoLogo = true, - }); - } -} - -[TaskName("Test")] -[IsDependentOn(typeof(BuildTask))] -public sealed class TestTask : FrostingTask -{ - public override void Run(BuildContext context) => context.DotNetTest(Constants.SolutionPath, new DotNetTestSettings - { - Configuration = Constants.Release, - Loggers = new[] { "console;verbosity=detailed", "trx" }, - ResultsDirectory = Constants.OutputDirectoryPath, - NoBuild = true, - NoLogo = true, - }); -} - -[TaskName("Pack")] -[IsDependentOn(typeof(TestTask))] -public sealed class PackTask : FrostingTask -{ - public override void Run(BuildContext context) => context.DotNetPack(Constants.MainProjectPath, new DotNetPackSettings - { - Configuration = Constants.Release, - MSBuildSettings = context.MSBuildSettings, - OutputDirectory = Constants.OutputDirectoryPath, - NoBuild = true, - NoRestore = true, - NoLogo = true, - }); -} - -[TaskName("Push")] -[IsDependentOn(typeof(PackTask))] -public sealed class PushTask : FrostingTask -{ - public override void Run(BuildContext context) - { - foreach (var packageFilePath in context.GetFiles(Path.Combine(Constants.OutputDirectoryPath, "*.nupkg"))) - { - context.DotNetNuGetPush(packageFilePath, new DotNetNuGetPushSettings - { - ApiKey = context.NugetApiKey, - Source = context.NugetSource, - IgnoreSymbols = false - }); - } - } -} - -[TaskName("Default")] -[IsDependentOn(typeof(PackTask))] -public sealed class DefaultTask : FrostingTask -{ -} \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 0000000..d179598 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "6.0.404", + "rollForward": "latestMinor", + "allowPrerelease": false + } +} \ No newline at end of file diff --git a/src/.editorconfig b/src/.editorconfig index 3962c49..a07fb26 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -166,7 +166,7 @@ dotnet_diagnostic.CA2002.severity = warning dotnet_diagnostic.CA2003.severity = none dotnet_diagnostic.CA2004.severity = none dotnet_diagnostic.CA2006.severity = none -dotnet_diagnostic.CA2007.severity = none +dotnet_diagnostic.CA2007.severity = error dotnet_diagnostic.CA2100.severity = warning dotnet_diagnostic.CA2101.severity = none dotnet_diagnostic.CA2102.severity = warning @@ -548,6 +548,7 @@ dotnet_diagnostic.CA1810.severity = none dotnet_diagnostic.CA1819.severity = warning dotnet_diagnostic.CA1822.severity = none dotnet_diagnostic.CA1824.severity = warning +dotnet_diagnostic.CA2007.severity = none dotnet_diagnostic.CA2229.severity = warning dotnet_diagnostic.CA2235.severity = warning -dotnet_diagnostic.xUnit1004.severity = none +dotnet_diagnostic.xUnit1004.severity = none \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 7774db3..4630605 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,13 +1,13 @@ - Copyright © Groupe GSoft inc. $([System.DateTime]::UtcNow.ToString(yyyy)) - Anthony Simmon - Groupe GSoft inc. + Copyright © GSoft Group Inc. $([System.DateTime]::UtcNow.ToString(yyyy)) + GSoft Group Inc. + GSoft Group Inc. https://github.com/gsoft-inc/gsoft-extensions-configuration-substitution Apache-2.0 10 enable - disable + enable Variable substitution configuration provider implementation for Microsoft.Extensions.Configuration. @@ -16,9 +16,18 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive + + all + runtime; build; native; contentfiles; analyzers + + + + + + \ No newline at end of file diff --git a/src/GSoft.Extensions.Configuration.Substitution.Tests/GSoft.Extensions.Configuration.Substitution.Tests.csproj b/src/GSoft.Extensions.Configuration.Substitution.Tests/GSoft.Extensions.Configuration.Substitution.Tests.csproj index 293b2ff..e33882d 100644 --- a/src/GSoft.Extensions.Configuration.Substitution.Tests/GSoft.Extensions.Configuration.Substitution.Tests.csproj +++ b/src/GSoft.Extensions.Configuration.Substitution.Tests/GSoft.Extensions.Configuration.Substitution.Tests.csproj @@ -1,6 +1,6 @@ - net462;net6.0;netcoreapp3.1 + net462;net6.0 false true true @@ -8,13 +8,17 @@ - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + runtime; build; native; contentfiles; analyzers; buildtransitive all - diff --git a/src/GSoft.Extensions.Configuration.Substitution/AssemblyProperties.cs b/src/GSoft.Extensions.Configuration.Substitution/AssemblyProperties.cs deleted file mode 100644 index 773818f..0000000 --- a/src/GSoft.Extensions.Configuration.Substitution/AssemblyProperties.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("GSoft.Extensions.Configuration.Substitution.Tests,PublicKey=" + - "0024000004800000940000000602000000240000525341310004000001000100554224641986a9" + - "270a61c8ec16d4bc4a0e4d61dac6927e90ceefd104a83febe45a7d2f2c8e85c33a3208a87395b4" + - "fb8a6af5d2435b77af22d24136767bc6e165e8b2efa908a7db7d25a4c5fbac96d0bfa9f40d7bbe" + - "1135264356883be1f011e9fcaa28f42ee9899b04297cdedf230da874af55f8a4b541588a39744a" + - "9dfeaa98")] \ No newline at end of file diff --git a/src/GSoft.Extensions.Configuration.Substitution/ChainedSubstitutedConfigurationProvider.cs b/src/GSoft.Extensions.Configuration.Substitution/ChainedSubstitutedConfigurationProvider.cs index 8bd6c4a..4fef391 100644 --- a/src/GSoft.Extensions.Configuration.Substitution/ChainedSubstitutedConfigurationProvider.cs +++ b/src/GSoft.Extensions.Configuration.Substitution/ChainedSubstitutedConfigurationProvider.cs @@ -30,7 +30,10 @@ public bool TryGet(string key, out string value) return true; } - public void Set(string key, string value) => this._configuration[key] = value; + public void Set(string key, string? value) + { + this._configuration[key] = value; + } public IChangeToken GetReloadToken() { diff --git a/src/GSoft.Extensions.Configuration.Substitution/GSoft.Extensions.Configuration.Substitution.csproj b/src/GSoft.Extensions.Configuration.Substitution/GSoft.Extensions.Configuration.Substitution.csproj index 1c29fc0..ea90f38 100644 --- a/src/GSoft.Extensions.Configuration.Substitution/GSoft.Extensions.Configuration.Substitution.csproj +++ b/src/GSoft.Extensions.Configuration.Substitution/GSoft.Extensions.Configuration.Substitution.csproj @@ -1,17 +1,23 @@ - net462;net6.0;netstandard2.0 + net6.0;netstandard2.0; True True snupkg GSoft.Extensions.Configuration.Substitution GSoft.Extensions.Configuration.Substitution - true true ../GSoft.Extensions.Configuration.Substitution.snk README.md + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + @@ -19,4 +25,8 @@ + + + + diff --git a/src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Shipped.txt b/src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Shipped.txt new file mode 100644 index 0000000..efa840f --- /dev/null +++ b/src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Shipped.txt @@ -0,0 +1,6 @@ +GSoft.Extensions.Configuration.Substitution.RecursiveConfigurationKeyException +GSoft.Extensions.Configuration.Substitution.RecursiveConfigurationKeyException.RecursiveConfigurationKeyException(System.Collections.Generic.IEnumerable! keyNames) -> void +GSoft.Extensions.Configuration.Substitution.UnresolvedConfigurationKeyException +GSoft.Extensions.Configuration.Substitution.UnresolvedConfigurationKeyException.UnresolvedConfigurationKeyException(string! keyName, string! requestingKeyName) -> void +Microsoft.Extensions.Configuration.ConfigurationSubstitutorBuilderExtensions +static Microsoft.Extensions.Configuration.ConfigurationSubstitutorBuilderExtensions.AddSubstitution(this Microsoft.Extensions.Configuration.IConfigurationBuilder! configurationBuilder, bool eagerValidation = false) -> Microsoft.Extensions.Configuration.IConfigurationBuilder! \ No newline at end of file diff --git a/src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Unshipped.txt b/src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Unshipped.txt new file mode 100644 index 0000000..815c920 --- /dev/null +++ b/src/GSoft.Extensions.Configuration.Substitution/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable \ No newline at end of file diff --git a/src/GSoft.Extensions.Configuration.Substitution/RecursiveConfigurationKeyException.cs b/src/GSoft.Extensions.Configuration.Substitution/RecursiveConfigurationKeyException.cs index 0885e2c..647f33d 100644 --- a/src/GSoft.Extensions.Configuration.Substitution/RecursiveConfigurationKeyException.cs +++ b/src/GSoft.Extensions.Configuration.Substitution/RecursiveConfigurationKeyException.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace GSoft.Extensions.Configuration.Substitution; public sealed class RecursiveConfigurationKeyException : Exception