diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 4632c89a..082a7b06 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -4,7 +4,7 @@ **ProjectTemplate** is a C# .NET template project that demonstrates best practices for C# .NET development. The project includes: -- **Library**: Core library with AOT compatibility (`Library.csproj`) +- **NuGetLibrary**: Core .NET NuGet library with AOT compatibility (`NuGetLibrary.csproj`, published as `ptr727.ProjectTemplate.Library`) - **Console**: Command-line application using System.CommandLine (`Console.csproj`) - **Tests**: Unit tests using xUnit and AwesomeAssertions (`Tests.csproj`) - **Benchmarks**: Performance benchmarks using BenchmarkDotNet (`Benchmarks.csproj`) @@ -43,7 +43,7 @@ Available VS Code tasks (use via `run_task` tool): 1. **File-Scoped Namespaces**: Always use file-scoped namespaces ```csharp - namespace ptr727.ProjectTemplate.Library; + namespace ptr727.ProjectTemplate.NuGetLibrary; ``` 2. **Nullable Reference Types**: Enabled (`enable`) @@ -92,7 +92,7 @@ Available VS Code tasks (use via `run_task` tool): ``` 4. **Namespace**: Follow format `ptr727.ProjectTemplate.` - - Library: `ptr727.ProjectTemplate.Library` + - NuGetLibrary: `ptr727.ProjectTemplate.NuGetLibrary` - Console: `ptr727.ProjectTemplate.Console` - Tests: `ptr727.ProjectTemplate.Tests` @@ -110,7 +110,7 @@ Available VS Code tasks (use via `run_task` tool): ```csharp using System.CommandLine; using System.Runtime.CompilerServices; - using ptr727.ProjectTemplate.Library; + using ptr727.ProjectTemplate.NuGetLibrary; namespace ptr727.ProjectTemplate.Console; ``` @@ -211,7 +211,7 @@ Available VS Code tasks (use via `run_task` tool): 1. **Target Framework**: .NET 10.0 (`net10.0`) -2. **AOT Compatibility**: Library is AOT compatible +2. **AOT Compatibility**: NuGetLibrary is AOT compatible - `true` - `true` @@ -292,7 +292,7 @@ Available VS Code tasks (use via `run_task` tool): - `CodeGen/` - Code generation utilities (internal tooling) - `Console/` - Console/CLI application using System.CommandLine - `Docker/` - Docker build scripts and Dockerfile -- `Library/` - Core reusable library +- `NuGetLibrary/` - Core reusable .NET NuGet library (published as `ptr727.ProjectTemplate.Library`) - `Tests/` - Unit tests using xUnit and AwesomeAssertions ## Best Practices diff --git a/.github/workflows/build-library-task.yml b/.github/workflows/build-nugetlibrary-task.yml similarity index 75% rename from .github/workflows/build-library-task.yml rename to .github/workflows/build-nugetlibrary-task.yml index 6bd1279b..0a5de77f 100644 --- a/.github/workflows/build-library-task.yml +++ b/.github/workflows/build-nugetlibrary-task.yml @@ -1,9 +1,9 @@ -name: Build library task +name: Build NuGet library task on: workflow_call: inputs: - # Input to control whether to push the library to NuGet.org + # Input to control whether to push the NuGet library to NuGet.org push: required: false type: boolean @@ -11,7 +11,7 @@ on: outputs: # Output of the uploaded artifact id artifact-id: - value: ${{ jobs.build-library.outputs.artifact-id }} + value: ${{ jobs.build-nugetlibrary.outputs.artifact-id }} jobs: @@ -20,8 +20,8 @@ jobs: uses: ./.github/workflows/get-version-task.yml secrets: inherit - build-library: - name: Build library project job + build-nugetlibrary: + name: Build NuGet library project job runs-on: ubuntu-latest outputs: artifact-id: ${{ steps.artifact-upload-step.outputs.artifact-id }} @@ -37,9 +37,9 @@ jobs: - name: Checkout code step uses: actions/checkout@v6 - - name: Build library project step + - name: Build NuGet library project step run: | - dotnet build ./Library/Library.csproj \ + dotnet build ./NuGetLibrary/NuGetLibrary.csproj \ -property:OutputPath=${{ runner.temp }}/publish/ \ -property:PackageOutputPath=${{ runner.temp }}/publish/ \ --configuration ${{ github.ref_name == 'main' && 'Release' || 'Debug' }} \ @@ -58,11 +58,11 @@ jobs: --skip-duplicate - name: Zip output step - run: 7z a -t7z ${{ runner.temp }}/Library.7z ${{ runner.temp }}/publish/* + run: 7z a -t7z ${{ runner.temp }}/NuGetLibrary.7z ${{ runner.temp }}/publish/* - name: Upload build artifacts step id: artifact-upload-step uses: actions/upload-artifact@v6 with: - name: library-build - path: ${{ runner.temp }}/Library.7z + name: nugetlibrary-build + path: ${{ runner.temp }}/NuGetLibrary.7z diff --git a/.github/workflows/build-release-task.yml b/.github/workflows/build-release-task.yml index 79ac2db7..27a0f6b8 100644 --- a/.github/workflows/build-release-task.yml +++ b/.github/workflows/build-release-task.yml @@ -26,9 +26,9 @@ jobs: uses: ./.github/workflows/get-version-task.yml secrets: inherit - build-library: - name: Build library job - uses: ./.github/workflows/build-library-task.yml + build-nugetlibrary: + name: Build NuGet library job + uses: ./.github/workflows/build-nugetlibrary-task.yml secrets: inherit with: # Conditional push to NuGet.org @@ -51,17 +51,17 @@ jobs: name: Publish GitHub release job if: ${{ inputs.github }} runs-on: ubuntu-latest - needs: [get-version, build-library, build-executable, build-docker] + needs: [get-version, build-nugetlibrary, build-executable, build-docker] steps: - name: Checkout code step uses: actions/checkout@v6 - - name: Download library build artifacts step + - name: Download NuGet library build artifacts step uses: actions/download-artifact@v7 with: - artifact-ids: ${{ needs.build-library.outputs.artifact-id }} + artifact-ids: ${{ needs.build-nugetlibrary.outputs.artifact-id }} path: ./Publish - name: Download executable build artifacts step diff --git a/AGENTS.md b/AGENTS.md index 8a49fcea..7028ac11 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -98,7 +98,7 @@ These conventions describe the target state. New and modified workflows must res ### Project Structure -- **Library**: Core reusable library +- **NuGetLibrary**: Core reusable .NET NuGet library (published as `ptr727.ProjectTemplate.Library`) - **Console**: CLI application using System.CommandLine - **Tests**: xUnit with AwesomeAssertions (Arrange-Act-Assert pattern) - **Benchmarks**: BenchmarkDotNet performance measurements diff --git a/Benchmarks/Benchmarks.csproj b/Benchmarks/Benchmarks.csproj index ab6aa801..fbf90517 100644 --- a/Benchmarks/Benchmarks.csproj +++ b/Benchmarks/Benchmarks.csproj @@ -7,6 +7,6 @@ - + diff --git a/Console/Console.csproj b/Console/Console.csproj index bc4ea6ae..ae14c9a1 100644 --- a/Console/Console.csproj +++ b/Console/Console.csproj @@ -21,6 +21,6 @@ - + diff --git a/Console/Program.cs b/Console/Program.cs index 45752492..5df60863 100644 --- a/Console/Program.cs +++ b/Console/Program.cs @@ -1,4 +1,4 @@ -using ptr727.ProjectTemplate.Library; +using ptr727.ProjectTemplate.NuGetLibrary; namespace ptr727.ProjectTemplate.Console; diff --git a/Library/.editorconfig b/NuGetLibrary/.editorconfig similarity index 100% rename from Library/.editorconfig rename to NuGetLibrary/.editorconfig diff --git a/Library/Extensions.cs b/NuGetLibrary/Extensions.cs similarity index 92% rename from Library/Extensions.cs rename to NuGetLibrary/Extensions.cs index 59709850..bdf0e4cd 100644 --- a/Library/Extensions.cs +++ b/NuGetLibrary/Extensions.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; -namespace ptr727.ProjectTemplate.Library; +namespace ptr727.ProjectTemplate.NuGetLibrary; internal static partial class LogExtensions { diff --git a/Library/GlobalUsings.cs b/NuGetLibrary/GlobalUsings.cs similarity index 100% rename from Library/GlobalUsings.cs rename to NuGetLibrary/GlobalUsings.cs diff --git a/Library/Library.cs b/NuGetLibrary/Library.cs similarity index 92% rename from Library/Library.cs rename to NuGetLibrary/Library.cs index 1f661bc7..b3cedf4f 100644 --- a/Library/Library.cs +++ b/NuGetLibrary/Library.cs @@ -1,4 +1,4 @@ -namespace ptr727.ProjectTemplate.Library; +namespace ptr727.ProjectTemplate.NuGetLibrary; /// /// Provides the primary library functionality. diff --git a/Library/LogOptions.cs b/NuGetLibrary/LogOptions.cs similarity index 96% rename from Library/LogOptions.cs rename to NuGetLibrary/LogOptions.cs index 9c63601c..382fc04a 100644 --- a/Library/LogOptions.cs +++ b/NuGetLibrary/LogOptions.cs @@ -1,4 +1,4 @@ -namespace ptr727.ProjectTemplate.Library; +namespace ptr727.ProjectTemplate.NuGetLibrary; /// /// Provides global logging configuration for the library. diff --git a/Library/Library.csproj b/NuGetLibrary/NuGetLibrary.csproj similarity index 94% rename from Library/Library.csproj rename to NuGetLibrary/NuGetLibrary.csproj index 6736346e..f08d6fd9 100644 --- a/Library/Library.csproj +++ b/NuGetLibrary/NuGetLibrary.csproj @@ -21,7 +21,7 @@ 1.0.0-pre true https://github.com/ptr727/ProjectTemplate - ptr727.ProjectTemplate.Library + ptr727.ProjectTemplate.NuGetLibrary snupkg 1.0.0.0 diff --git a/Library/Options.cs b/NuGetLibrary/Options.cs similarity index 85% rename from Library/Options.cs rename to NuGetLibrary/Options.cs index cef2b103..04d51a70 100644 --- a/Library/Options.cs +++ b/NuGetLibrary/Options.cs @@ -1,4 +1,4 @@ -namespace ptr727.ProjectTemplate.Library; +namespace ptr727.ProjectTemplate.NuGetLibrary; /// /// Options used to configure the library. diff --git a/ProjectTemplate.code-workspace b/ProjectTemplate.code-workspace index 0ad06819..b8714f6a 100644 --- a/ProjectTemplate.code-workspace +++ b/ProjectTemplate.code-workspace @@ -32,6 +32,7 @@ "logfile", "nameof", "nbgv", + "nugetlibrary", "nektos", "Nerdbank", "noninteractive", diff --git a/ProjectTemplate.slnx b/ProjectTemplate.slnx index c8e900d4..7e3cc9c6 100644 --- a/ProjectTemplate.slnx +++ b/ProjectTemplate.slnx @@ -3,7 +3,7 @@ - + @@ -24,14 +24,14 @@ - + - + - + - + diff --git a/Tests/LoggingTests.cs b/Tests/LoggingTests.cs index 9f43dca7..2d8f8a65 100644 --- a/Tests/LoggingTests.cs +++ b/Tests/LoggingTests.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ptr727.ProjectTemplate.Library; +using ptr727.ProjectTemplate.NuGetLibrary; namespace ptr727.ProjectTemplate.Tests; diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 8c53010d..6cf10d59 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -14,6 +14,6 @@ - +