From e36eb2d8b1a35cdcb8cb6b2815146e8595a5d7ca Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Fri, 19 Jan 2024 16:25:31 -0800 Subject: [PATCH 1/8] Miscellaneous updates. --- .editorconfig | 7 +++++++ .gitignore | 13 +++++++------ Directory.Build.props | 18 +++++++++--------- Directory.Packages.props | 17 +++++++++++++++++ LICENSE | 2 +- RepoTemplate.sln | 3 ++- global.json | 6 ++++++ nuget.config | 3 ++- tools/Build/Build.csproj | 4 ++-- tools/XmlDocGen/XmlDocGen.csproj | 4 ++-- 10 files changed, 55 insertions(+), 22 deletions(-) create mode 100644 Directory.Packages.props create mode 100644 global.json diff --git a/.editorconfig b/.editorconfig index 131b58e..1cc8a20 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,6 +17,9 @@ resharper_comment_typo_highlighting = none resharper_identifier_typo_highlighting = none resharper_string_literal_typo_highlighting = none +[Directory.Packages.props] +insert_final_newline = false + [dotnet-tools.json] insert_final_newline = false @@ -87,6 +90,7 @@ csharp_style_prefer_local_over_anonymous_function = true : suggestion csharp_style_prefer_not_pattern = true : suggestion csharp_style_prefer_null_check_over_type_check = true : suggestion csharp_style_prefer_pattern_matching = true : suggestion +csharp_style_prefer_primary_constructors = true : suggestion csharp_style_prefer_range_operator = true : suggestion csharp_style_prefer_switch_expression = true : suggestion csharp_style_prefer_tuple_swap = true : warning @@ -203,7 +207,9 @@ dotnet_diagnostic.IDE0160.severity = suggestion dotnet_diagnostic.IDE0161.severity = suggestion dotnet_diagnostic.IDE0170.severity = suggestion dotnet_diagnostic.IDE0180.severity = warning +dotnet_diagnostic.IDE0290.severity = suggestion dotnet_diagnostic.IDE1005.severity = suggestion +dotnet_diagnostic.NUnit2045.severity = suggestion dotnet_diagnostic.SA0001.severity = none dotnet_diagnostic.SA1003.severity = none dotnet_diagnostic.SA1008.severity = none @@ -326,6 +332,7 @@ resharper_arrange_missing_parentheses_highlighting = hint resharper_arrange_trailing_comma_in_multiline_lists_highlighting = warning resharper_comment_typo_highlighting = none resharper_compare_of_floats_by_equality_operator_highlighting = suggestion +resharper_convert_to_primary_constructor_highlighting = hint resharper_csharp_align_first_arg_by_paren = false resharper_csharp_align_linq_query = false resharper_csharp_align_multiline_argument = false diff --git a/.gitignore b/.gitignore index 4aa6cfb..a2ad192 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,16 @@ +.vs/ +.idea/ +artifacts/ bin/ obj/ release/ -.vs/ -.idea/ -Thumbs.db + *.cache -*.user -*.userprefs +*.log *.ncrunchproject *.ncrunchsolution +*.user +launchSettings.json nCrunchTemp* _ReSharper* .DS_Store -launchSettings.json diff --git a/Directory.Build.props b/Directory.Build.props index 84c833b..2032416 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,12 +2,13 @@ 0.0.0 - 11.0 + 0.0.0 + 12.0 enable enable true + $(NoWarn);1591;1998;NU1507;NU5105 en-US - $(NoWarn);1591;1998;NU5105 embedded FacilityApi RepoTemplate @@ -20,11 +21,16 @@ true true true - AllEnabledByDefault + latest-all true true false false + false + true + true + true + true @@ -32,10 +38,4 @@ true - - - - - - diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..4e448ce --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,17 @@ + + + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE index 2fd22c4..df586e7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright 2022 Ed Ball +Copyright 2024 Ed Ball Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/RepoTemplate.sln b/RepoTemplate.sln index 2f3f9e0..b3b6464 100644 --- a/RepoTemplate.sln +++ b/RepoTemplate.sln @@ -11,7 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution build.ps1 = build.ps1 .github\workflows\build.yaml = .github\workflows\build.yaml Directory.Build.props = Directory.Build.props - dotnet-tools.json = dotnet-tools.json + Directory.Packages.props = Directory.Packages.props + global.json = global.json LICENSE = LICENSE nuget.config = nuget.config README.md = README.md diff --git a/global.json b/global.json new file mode 100644 index 0000000..391ba3c --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "8.0.100", + "rollForward": "latestFeature" + } +} diff --git a/nuget.config b/nuget.config index 3d2c236..19d85b7 100644 --- a/nuget.config +++ b/nuget.config @@ -1,4 +1,5 @@ - + + diff --git a/tools/Build/Build.csproj b/tools/Build/Build.csproj index 3fda495..94c9978 100644 --- a/tools/Build/Build.csproj +++ b/tools/Build/Build.csproj @@ -2,11 +2,11 @@ Exe - net7.0 + net8.0 - + diff --git a/tools/XmlDocGen/XmlDocGen.csproj b/tools/XmlDocGen/XmlDocGen.csproj index c09765c..451944a 100644 --- a/tools/XmlDocGen/XmlDocGen.csproj +++ b/tools/XmlDocGen/XmlDocGen.csproj @@ -2,14 +2,14 @@ Exe - net7.0 + net8.0 - + From 035032d79e471969de688ac398fe4ae550d07de7 Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Fri, 22 Mar 2024 15:52:33 -0700 Subject: [PATCH 2/8] Miscellaneous updates. --- .github/workflows/build.yaml | 28 ++++++++++------------------ Directory.Packages.props | 4 ++-- build.ps1 | 11 +++-------- nuget.config | 2 +- 4 files changed, 16 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index da56fbe..7aed6c1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,24 +1,20 @@ name: Build + on: - workflow_dispatch: push: - paths-ignore: - - '*.md' - - 'docs/**' - branches: - - 'master' - tags-ignore: - - '**' + branches: [master] + tags-ignore: ['**'] pull_request: - paths-ignore: - - '*.md' - - 'docs/**' + workflow_dispatch: + env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_NOLOGO: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 + defaults: run: shell: pwsh + jobs: build: runs-on: ${{ matrix.os }} @@ -26,14 +22,10 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: + - name: Install .NET + uses: actions/setup-dotnet@v3 - name: Check out code uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up .NET 7 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - name: Restore run: .\build.ps1 restore - name: Build diff --git a/Directory.Packages.props b/Directory.Packages.props index 4e448ce..94952e4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,14 +4,14 @@ - + - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 21a0bb6..9b32821 100755 --- a/build.ps1 +++ b/build.ps1 @@ -2,14 +2,9 @@ $ErrorActionPreference = 'Stop' Push-Location $PSScriptRoot try { - if (-not (Test-Path ./tools/bin/Build) -or - (Get-ChildItem ./tools/Build/* | Measure-Object LastWriteTime -Maximum).Maximum -gt - (Get-ChildItem ./tools/bin/Build/* | Measure-Object LastWriteTime -Maximum).Maximum) { - if (Test-Path ./tools/bin/Build) { Remove-Item ./tools/bin/Build -Recurse } - dotnet publish ./tools/Build/Build.csproj --output ./tools/bin/Build --nologo --verbosity quiet - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - } - dotnet ./tools/bin/Build/Build.dll $args + dotnet publish ./tools/Build/Build.csproj --artifacts-path ./artifacts --nologo --verbosity quiet + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet ./artifacts/publish/Build/release/Build.dll $args if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } finally { diff --git a/nuget.config b/nuget.config index 19d85b7..6873eb9 100644 --- a/nuget.config +++ b/nuget.config @@ -1,4 +1,4 @@ - + From 699dfaf965deaa4a64c00cd683027e9c987111fd Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Fri, 22 Mar 2024 18:52:06 -0700 Subject: [PATCH 3/8] Don't align raw literal string content. --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 1cc8a20..3b97902 100644 --- a/.editorconfig +++ b/.editorconfig @@ -354,6 +354,7 @@ resharper_csharp_indent_anonymous_method_block = false resharper_csharp_indent_nested_for_stmt = true resharper_csharp_indent_nested_foreach_stmt = true resharper_csharp_indent_nested_while_stmt = true +resharper_csharp_indent_raw_literal_string = indent resharper_csharp_int_align = false resharper_csharp_keep_existing_arrangement = true resharper_csharp_nested_ternary_style = simple_wrap From ba84bb9ee1a97b27382c53b8b8487d6be5db7a3a Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Sat, 23 Mar 2024 07:26:40 -0700 Subject: [PATCH 4/8] Allow explicit docs publish. --- .github/workflows/publish-docs.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/publish-docs.yaml diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml new file mode 100644 index 0000000..2e72880 --- /dev/null +++ b/.github/workflows/publish-docs.yaml @@ -0,0 +1,27 @@ +name: Publish Docs + +on: + workflow_dispatch: + +env: + DOTNET_NOLOGO: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + +defaults: + run: + shell: pwsh + +jobs: + publish-docs: + runs-on: windows-latest + steps: + - name: Install .NET + uses: actions/setup-dotnet@v3 + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # required to publish docs + - name: Publish Docs + env: + BUILD_BOT_PASSWORD: ${{ secrets.BUILD_BOT_PASSWORD }} + run: .\build.ps1 publish --no-test --trigger publish-docs From f590b402c23685ec14415718c36547b928376e50 Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Sat, 23 Mar 2024 07:35:35 -0700 Subject: [PATCH 5/8] Update dependencies. --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 94952e4..42162e6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,13 +5,13 @@ - + - - + + \ No newline at end of file From a82d4842e8fbb791430029e51a1a66300a91a5aa Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Mon, 25 Mar 2024 17:09:30 -0700 Subject: [PATCH 6/8] Fix docs publish. --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7aed6c1..de4f15b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,6 +26,8 @@ jobs: uses: actions/setup-dotnet@v3 - name: Check out code uses: actions/checkout@v3 + with: + fetch-depth: 0 # required to publish docs - name: Restore run: .\build.ps1 restore - name: Build From e781147cf2018997f58d6a578e673c5fc78c9b32 Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Tue, 14 May 2024 18:35:30 -0700 Subject: [PATCH 7/8] Update dependency. --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 42162e6..8b8ad42 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -11,7 +11,7 @@ - + \ No newline at end of file From 4a900673efca074f1c4e90752ea3b742fbaaba0c Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Fri, 17 May 2024 10:24:56 -0700 Subject: [PATCH 8/8] Install .NET 6.0 and 8.0 SDKs. --- .github/workflows/build.yaml | 4 ++++ .github/workflows/publish-docs.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index de4f15b..a313bbb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,6 +24,10 @@ jobs: steps: - name: Install .NET uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 8.0.x - name: Check out code uses: actions/checkout@v3 with: diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index 2e72880..ca0e689 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -17,6 +17,10 @@ jobs: steps: - name: Install .NET uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 8.0.x - name: Check out code uses: actions/checkout@v3 with: