Skip to content

Commit d7ee6c8

Browse files
committed
Initial commit
1 parent 453e138 commit d7ee6c8

23 files changed

+1214
-1
lines changed

.editorconfig

+421
Large diffs are not rendered by default.

.vscode/launch.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/test/CZ.Extensions.Configuration.ReferenceResolver.Tests/bin/Debug/netcoreapp3.1/CZ.Extensions.Configuration.ReferenceResolver.Tests.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}/test/CZ.Extensions.Configuration.ReferenceResolver.Tests",
16+
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17+
"console": "internalConsole",
18+
"stopAtEntry": false
19+
},
20+
{
21+
"name": ".NET Core Attach",
22+
"type": "coreclr",
23+
"request": "attach",
24+
"processId": "${command:pickProcess}"
25+
}
26+
]
27+
}

.vscode/tasks.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"group": {
9+
"kind": "build",
10+
"isDefault": true
11+
},
12+
"args": [
13+
"build",
14+
"${workspaceFolder}/test/CZ.Extensions.Configuration.ReferenceResolver.Tests/CZ.Extensions.Configuration.ReferenceResolver.Tests.csproj",
15+
"/property:GenerateFullPaths=true",
16+
"/consoleloggerparameters:NoSummary"
17+
],
18+
"problemMatcher": "$msCompile"
19+
},
20+
{
21+
"label": "publish",
22+
"command": "dotnet",
23+
"type": "process",
24+
"args": [
25+
"publish",
26+
"${workspaceFolder}/test/CZ.Extensions.Configuration.ReferenceResolver.Tests/CZ.Extensions.Configuration.ReferenceResolver.Tests.csproj",
27+
"/property:GenerateFullPaths=true",
28+
"/consoleloggerparameters:NoSummary"
29+
],
30+
"problemMatcher": "$msCompile"
31+
},
32+
{
33+
"label": "watch",
34+
"command": "dotnet",
35+
"type": "process",
36+
"args": [
37+
"watch",
38+
"run",
39+
"${workspaceFolder}/test/CZ.Extensions.Configuration.ReferenceResolver.Tests/CZ.Extensions.Configuration.ReferenceResolver.Tests.csproj",
40+
"/property:GenerateFullPaths=true",
41+
"/consoleloggerparameters:NoSummary"
42+
],
43+
"problemMatcher": "$msCompile"
44+
}
45+
]
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26124.0
5+
MinimumVisualStudioVersion = 15.0.26124.0
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3FBF03F0-C0F8-4FE6-9249-0846A35DF65D}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CZ.Extensions.Configuration.ReferenceResolver", "src\CZ.Extensions.Configuration.ReferenceResolver\CZ.Extensions.Configuration.ReferenceResolver.csproj", "{6ACD3199-5849-47BD-9F99-85E2232F9DE6}"
9+
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2DC9E32A-B558-482A-87B6-D46B14330F87}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CZ.Extensions.Configuration.ReferenceResolver.Tests", "test\CZ.Extensions.Configuration.ReferenceResolver.Tests\CZ.Extensions.Configuration.ReferenceResolver.Tests.csproj", "{89737D7C-2712-432F-A17A-A08EB8DDBC58}"
13+
EndProject
14+
Global
15+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16+
Debug|Any CPU = Debug|Any CPU
17+
Debug|x64 = Debug|x64
18+
Debug|x86 = Debug|x86
19+
Release|Any CPU = Release|Any CPU
20+
Release|x64 = Release|x64
21+
Release|x86 = Release|x86
22+
EndGlobalSection
23+
GlobalSection(SolutionProperties) = preSolution
24+
HideSolutionNode = FALSE
25+
EndGlobalSection
26+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
27+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
29+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Debug|x64.ActiveCfg = Debug|Any CPU
30+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Debug|x64.Build.0 = Debug|Any CPU
31+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Debug|x86.ActiveCfg = Debug|Any CPU
32+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Debug|x86.Build.0 = Debug|Any CPU
33+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
34+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Release|Any CPU.Build.0 = Release|Any CPU
35+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Release|x64.ActiveCfg = Release|Any CPU
36+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Release|x64.Build.0 = Release|Any CPU
37+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Release|x86.ActiveCfg = Release|Any CPU
38+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6}.Release|x86.Build.0 = Release|Any CPU
39+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
40+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Debug|Any CPU.Build.0 = Debug|Any CPU
41+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Debug|x64.ActiveCfg = Debug|Any CPU
42+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Debug|x64.Build.0 = Debug|Any CPU
43+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Debug|x86.ActiveCfg = Debug|Any CPU
44+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Debug|x86.Build.0 = Debug|Any CPU
45+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Release|Any CPU.ActiveCfg = Release|Any CPU
46+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Release|Any CPU.Build.0 = Release|Any CPU
47+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Release|x64.ActiveCfg = Release|Any CPU
48+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Release|x64.Build.0 = Release|Any CPU
49+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Release|x86.ActiveCfg = Release|Any CPU
50+
{89737D7C-2712-432F-A17A-A08EB8DDBC58}.Release|x86.Build.0 = Release|Any CPU
51+
EndGlobalSection
52+
GlobalSection(NestedProjects) = preSolution
53+
{6ACD3199-5849-47BD-9F99-85E2232F9DE6} = {3FBF03F0-C0F8-4FE6-9249-0846A35DF65D}
54+
{89737D7C-2712-432F-A17A-A08EB8DDBC58} = {2DC9E32A-B558-482A-87B6-D46B14330F87}
55+
EndGlobalSection
56+
EndGlobal

README.md

+51-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
11
# CZ.Extensions.Configuration.ReferenceResolver
2-
Allows references in configuations in dotnet core
2+
3+
This is reference resolver in configuations used in dotnet core.
4+
5+
## NuGet
6+
7+
The configuration reference resolver is provided as a nuget package and can be found on nuget.org.
8+
9+
| Name | Status |
10+
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11+
| CZ.Extensions.Configuration.ReferenceResolver | [![Nuget Badge](https://img.shields.io/nuget/v/CZ.Extensions.Configuration.ReferenceResolver.svg)](https://www.nuget.org/packages/CZ.Extensions.Configuration.ReferenceResolver/) |
12+
13+
You can add the package for example with the following `dotnet` command:
14+
15+
```bash
16+
dotnet add package CZ.Extensions.Configuration.ReferenceResolver
17+
```
18+
19+
Pre-releases of this Package are pushed to an internal feed on [Azure Artifacts](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_packaging?_a=feed&feed=CZ.Extensions.Configuration.ReferenceResolver).
20+
21+
There are also packages from pull requests released in an other [Azure Artifacts](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_packaging?_a=feed&feed=CZ.Extensions.Configuration.ReferenceResolver-PR) feed. All Packages in this feed are named like this: `PR-{pull request number}-CZ.Extensions.Configuration.ReferenceResolver`. So you must only pick the package of your PR to check your changes in a test project. All changes of the pull request are tracked in the pull request package version history.
22+
23+
## Build
24+
25+
The build environment for this project is on Azure Pipelines and can be found here [dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_build).
26+
27+
### Nuget package build
28+
29+
| Name | Status |
30+
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
31+
| CZ.Extensions.Configuration.ReferenceResolver-CI | [![Build Status](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_apis/build/status/CZ.Extensions.Configuration.ReferenceResolver-CI)](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_build/latest?definitionId=24) |
32+
| Alpha | [![Alpha](https://vsrm.dev.azure.com/czon/_apis/public/Release/badge/f220b54d-531a-4d09-a74c-6970e62194ca/2/2)](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_releases2?definitionId=1&_a=releases) |
33+
| Beta | [![Beta](https://vsrm.dev.azure.com/czon/_apis/public/Release/badge/f220b54d-531a-4d09-a74c-6970e62194ca/2/3)](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_releases2?definitionId=1&_a=releases) |
34+
| Release | [![Release](https://vsrm.dev.azure.com/czon/_apis/public/Release/badge/f220b54d-531a-4d09-a74c-6970e62194ca/2/4)](https://dev.azure.com/czon/CZ.Extensions.Configuration.ReferenceResolver/_releases2?definitionId=1&_a=releases) |
35+
36+
## Usage
37+
38+
> **INFO**: For detailed usage information please have a look in the `samples` folder.
39+
40+
ToDo!
41+
42+
## Authors
43+
44+
- **Kirsten Kluge** - _Initial work_ - [kirkone](https://github.com/kirkone)
45+
46+
See also the list of [contributors](https://github.com/codez-one/CZ.Extensions.Configuration.ReferenceResolver/graphs/contributors) who participated in this project.
47+
48+
## License
49+
50+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
51+
52+
## Acknowledgments

global.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "3.1.102"
4+
}
5+
}

omnisharp.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"RoslynExtensionsOptions": {
3+
"enableAnalyzersSupport": true
4+
},
5+
"FormattingOptions": {
6+
"enableEditorConfigSupport": true
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema?view=vsts
2+
3+
trigger:
4+
batch: true
5+
branches:
6+
include:
7+
- 'master'
8+
9+
pr:
10+
autoCancel: true
11+
branches:
12+
include:
13+
- master
14+
15+
pool:
16+
vmImage: 'windows-latest'
17+
18+
variables:
19+
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
20+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
21+
# Disable sending usage data to Microsoft
22+
DOTNET_CLI_TELEMETRY_OPTOUT: true
23+
BuildConfiguration: 'Release'
24+
Project: '$(Build.SourcesDirectory)/src/CZ.Extensions.Configuration.ReferenceResolver/CZ.Extensions.Configuration.ReferenceResolver.csproj'
25+
ProjectFolder: '$(Build.SourcesDirectory)/src/CZ.Extensions.Configuration.ReferenceResolver'
26+
GitVersion: '5.1.3'
27+
28+
name: $(Year:yy)$(DayOfYear)$(Rev:rr)
29+
30+
stages:
31+
- stage: 'Build'
32+
jobs:
33+
- job: 'Build'
34+
steps:
35+
- task: UseDotNet@2
36+
displayName: 'Install dotnet core SDK'
37+
inputs:
38+
packageType: 'sdk'
39+
useGlobalJson: true
40+
41+
- task: DotNetCoreCLI@2
42+
displayName: 'Install GitVersion: $(GitVersion)'
43+
inputs:
44+
command: custom
45+
custom: 'tool'
46+
arguments: 'install GitVersion.Tool --version $(GitVersion) --tool-path ./pipelines/tools/gitversion'
47+
48+
- task: PowerShell@2
49+
displayName: 'Run GitVersion'
50+
inputs:
51+
targetType: 'filePath'
52+
filePath: 'pipelines/tools/Run-GitVersion.ps1'
53+
arguments: '-Verbose'
54+
workingDirectory: '$(ProjectFolder)'
55+
56+
- task: DotNetCoreCLI@2
57+
displayName: 'Restore'
58+
inputs:
59+
command: 'restore'
60+
projects: '$(Project)'
61+
62+
- task: DotNetCoreCLI@2
63+
displayName: 'Build'
64+
inputs:
65+
command: 'build'
66+
projects: '$(Project)'
67+
arguments: '--configuration $(buildConfiguration) --no-restore'
68+
69+
- task: DotNetCoreCLI@2
70+
displayName: 'Test'
71+
inputs:
72+
command: 'test'
73+
projects: 'test/**/*.csproj'
74+
arguments: '--configuration $(buildConfiguration)'
75+
testRunTitle: '$(Build.BuildNumber)'
76+
77+
- template: templates/NuGet.Pack.yaml
78+
parameters:
79+
name: 'PR'
80+
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
81+
buildProperties: 'VersionPrefix=$(GitVersion.MajorMinorPatch);VersionSuffix=pre-$(Build.BuildNumber);PackageId=PR-$(System.PullRequest.pullRequestNumber)-CZ.Extensions.Configuration.ReferenceResolver'
82+
83+
- template: templates/NuGet.Pack.yaml
84+
parameters:
85+
name: 'Internal'
86+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
87+
buildProperties: 'VersionPrefix=$(GitVersion.MajorMinorPatch);VersionSuffix=pre-$(Build.BuildNumber)'
88+
89+
- template: templates/NuGet.Pack.yaml
90+
parameters:
91+
name: 'Release'
92+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
93+
buildProperties: 'VersionPrefix=$(GitVersion.MajorMinorPatch);VersionSuffix='
94+
95+
- task: PublishBuildArtifacts@1
96+
displayName: 'Publish Artifact'
97+
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest')))
98+
inputs:
99+
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
100+
artifactName: NuGet
101+
parallel: true

pipelines/templates/NuGet.Pack.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
- name: 'name'
3+
type: string
4+
default: ''
5+
- name: 'buildProperties'
6+
type: string
7+
default: 'VersionPrefix=$(GitVersion.MajorMinorPatch);VersionSuffix='
8+
- name: 'condition'
9+
10+
steps:
11+
- task: DotNetCoreCLI@2
12+
displayName: 'Pack ${{ parameters.name }}'
13+
condition: '${{ parameters.condition }}'
14+
inputs:
15+
command: 'pack'
16+
packagesToPack: '$(Project)'
17+
nobuild: true
18+
arguments: '--configuration $(buildConfiguration) --no-restore'
19+
buildProperties: '${{ parameters.buildProperties }}'
20+
packDirectory: '$(Build.ArtifactStagingDirectory)'
21+
verbosityPack: Normal

pipelines/tools/Run-GitVersion.ps1

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[CmdletBinding(DefaultParameterSetName = 'None')]
2+
Param()
3+
4+
Begin {
5+
Write-Verbose "Entering script Run-GitVersion.ps1"
6+
}
7+
8+
Process {
9+
Write-Verbose "Running GitVersion ..."
10+
$gitversionoutput = & "$PSScriptRoot/gitversion/dotnet-gitversion*" $PWD /updateassemblyinfo AssemblyInfo.cs /ensureassemblyinfo /output json
11+
Write-Verbose " Done"
12+
13+
$jsonObj = "$gitversionoutput" | ConvertFrom-Json
14+
15+
Write-Verbose "Writing variables ..."
16+
foreach ($property in $jsonObj.PSObject.Properties) {
17+
Write-Verbose " GitVersion.$($property.Name): $($property.Value)"
18+
Write-Output "##vso[task.setvariable variable=GitVersion.$($property.Name);]$($property.Value)"
19+
}
20+
Write-Verbose " Done"
21+
}
22+
23+
End {
24+
Write-Verbose "Leaving script Run-GitVersion.ps1"
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace CZ.Extensions.Configuration.ReferenceResolver.Samples.Web
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using Microsoft.AspNetCore.Hosting;
8+
using Microsoft.Extensions.Configuration;
9+
using Microsoft.Extensions.Hosting;
10+
using Microsoft.Extensions.Logging;
11+
12+
public class Program
13+
{
14+
public static void Main(string[] args)
15+
{
16+
CreateHostBuilder(args).Build().Run();
17+
}
18+
19+
public static IHostBuilder CreateHostBuilder(string[] args) =>
20+
Host.CreateDefaultBuilder(args)
21+
.ConfigureWebHostDefaults(webBuilder =>
22+
{
23+
webBuilder.UseStartup<Startup>();
24+
});
25+
}
26+
}

0 commit comments

Comments
 (0)