Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ Available VS Code tasks (use via `run_task` tool):
</ItemGroup>
```

5. **Directory.Build.props**: Common MSBuild properties shared across all projects
(`TargetFramework`, `Nullable`, `ImplicitUsings`, `AnalysisLevel`, `AnalysisMode`,
`EnableNETAnalyzers`, `ArtifactsPath`, `IsPackable`, `ManagePackageVersionsCentrally`)
live here at the solution root. Only add a property to a `.csproj` when it is
specific to that project or requires an explicit override of the shared default.

6. **Directory.Packages.props**: All NuGet package versions are centralised here via
`PackageVersion` items. Individual `.csproj` files use `PackageReference Include="..."`
with no `Version` attribute. Asset metadata (`PrivateAssets`, `IncludeAssets`) stays
in the `.csproj` `PackageReference` element. Use `VersionOverride` only when a project
genuinely requires a different version from the central default.

### Code Formatting Tools

1. **CSharpier**: Primary code formatter
Expand Down
47 changes: 24 additions & 23 deletions .github/workflows/run-periodic-codegen-app-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
name: Run weekly CodeGen App and Pull Request action

on:
workflow_dispatch:
schedule:
# Run weekly on Thursdays at 02:00 UTC (PAT workflow runs on Mondays)
- cron: '0 2 * * THU'

concurrency:
group: codegen-${{ github.ref }}
cancel-in-progress: true

jobs:

run-codegen-app:
name: Run codegen app and pull request job
uses: ./.github/workflows/run-codegen-app-pull-request-task.yml
secrets:
CODEGEN_APP_ID: ${{ secrets.CODEGEN_APP_ID }}
CODEGEN_APP_PRIVATE_KEY: ${{ secrets.CODEGEN_APP_PRIVATE_KEY }}
permissions:
contents: write
pull-requests: write
name: Run weekly CodeGen App and Pull Request action

on:
workflow_dispatch:
schedule:
# Run weekly on Thursdays at 02:00 UTC (PAT workflow runs on Mondays)
- cron: '0 2 * * THU'

concurrency:
# Workflow always checks out and targets main/codegen
group: codegen-main
cancel-in-progress: true

jobs:

run-codegen-app:
name: Run codegen app and pull request job
uses: ./.github/workflows/run-codegen-app-pull-request-task.yml
secrets:
CODEGEN_APP_ID: ${{ secrets.CODEGEN_APP_ID }}
CODEGEN_APP_PRIVATE_KEY: ${{ secrets.CODEGEN_APP_PRIVATE_KEY }}
permissions:
contents: write
pull-requests: write
3 changes: 2 additions & 1 deletion .github/workflows/run-periodic-codegen-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
- cron: '0 2 * * MON'

concurrency:
group: codegen-${{ github.ref }}
# Workflow always checks out and targets main/codegen
group: codegen-main
cancel-in-progress: true

jobs:
Expand Down
102 changes: 51 additions & 51 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Console Root",
"type": "coreclr",
"request": "launch",
"preLaunchTask": ".Net Build",
"program": "${workspaceFolder}/Console/bin/Debug/net10.0/Console.dll",
"args": [
"--loglevel=Debug",
"--logfile=console.log",
"--logfile-clear=true"
],
"cwd": "${workspaceFolder}/Console/bin/Debug/net10.0",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Console Test",
"type": "coreclr",
"request": "launch",
"preLaunchTask": ".Net Build",
"program": "${workspaceFolder}/Console/bin/Debug/net10.0/Console.dll",
"args": [
"--loglevel=Debug",
"--logfile=console.log",
"--logfile-clear=true",
"test",
"--test=test"
],
"cwd": "${workspaceFolder}/Console/bin/Debug/net10.0",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "CodeGen",
"type": "coreclr",
"request": "launch",
"preLaunchTask": ".Net Build",
"program": "${workspaceFolder}/CodeGen/bin/Debug/net10.0/CodeGen.dll",
"args": [
"--codepath",
"${workspaceFolder}/CodeGen"
],
"cwd": "${workspaceFolder}/CodeGen/bin/Debug/net10.0",
"console": "internalConsole",
"stopAtEntry": false
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "Console Root",
"type": "coreclr",
"request": "launch",
"preLaunchTask": ".Net Build",
"program": "${workspaceFolder}/.artifacts/bin/Console/Debug/Console.dll",
"args": [
"--loglevel=Debug",
"--logfile=console.log",
"--logfile-clear=true"
],
"cwd": "${workspaceFolder}/.artifacts/bin/Console/Debug",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Console Test",
"type": "coreclr",
"request": "launch",
"preLaunchTask": ".Net Build",
"program": "${workspaceFolder}/.artifacts/bin/Console/Debug/Console.dll",
"args": [
"--loglevel=Debug",
"--logfile=console.log",
"--logfile-clear=true",
"test",
"--test=test"
],
"cwd": "${workspaceFolder}/.artifacts/bin/Console/Debug",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "CodeGen",
"type": "coreclr",
"request": "launch",
"preLaunchTask": ".Net Build",
"program": "${workspaceFolder}/.artifacts/bin/CodeGen/Debug/CodeGen.dll",
"args": [
"--codepath",
"${workspaceFolder}/CodeGen"
],
"cwd": "${workspaceFolder}/.artifacts/bin/CodeGen/Debug",
"console": "internalConsole",
"stopAtEntry": false
}
]
}
22 changes: 22 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,28 @@
"clear": false
}
},
{
"label": ".Net Benchmark",
"type": "process",
"command": "dotnet",
"args": [
"run",
"--project",
"${workspaceFolder}/Benchmarks/Benchmarks.csproj",
"-c",
"Release",
"--",
"--artifacts",
"${workspaceFolder}/.artifacts/benchmarks"
],
"problemMatcher": [
"$msCompile"
],
"presentation": {
"showReuseMessage": false,
"clear": false
}
},
{
"label": ".Net Outdated Upgrade",
"type": "process",
Expand Down
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ For comprehensive coding standards and detailed conventions, refer to [`.github/
- `<EnableNETAnalyzers>true</EnableNETAnalyzers>`
- `<AnalysisLevel>latest-all</AnalysisLevel>`

### Project Configuration

- Common MSBuild properties (`TargetFramework`, `Nullable`, `ImplicitUsings`, `AnalysisLevel`, etc.)
live in `Directory.Build.props` at the solution root. Do not duplicate these in individual `.csproj`
files — only add a property to a `.csproj` when it is project-specific or overrides the shared default.
- All NuGet package versions are centralised in `Directory.Packages.props`. `PackageReference` elements
in `.csproj` files must not include a `Version` attribute. Asset metadata (`PrivateAssets`,
`IncludeAssets`) stays in the `.csproj` `PackageReference` element.

### Development Environment

- Target latest .NET SDK (currently .NET 10 with C# 14)
Expand Down
7 changes: 1 addition & 6 deletions Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AnalysisLevel>latest-all</AnalysisLevel>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<RootNamespace>ptr727.ProjectTemplate.Benchmarks</RootNamespace>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<PackageReference Include="BenchmarkDotNet" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Library\Library.csproj" />
Expand Down
1 change: 0 additions & 1 deletion Benchmarks/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
global using System;
global using BenchmarkDotNet.Attributes;
global using BenchmarkDotNet.Running;
2 changes: 1 addition & 1 deletion CodeGen/CodeGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal static class CodeGen

internal static void Quote()
{
const string dateTime = "2026-01-30T22:28:14.6290903Z";
const string dateTime = "2026-04-13T22:37:43.5686751Z";
Console.WriteLine($"{dateTime} : {QuoteOfTheDay}");
Log.Logger.Information("Quote of the Day: {DateTime} : {Quote}", dateTime, QuoteOfTheDay);
}
Expand Down
17 changes: 6 additions & 11 deletions CodeGen/CodeGen.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AnalysisLevel>latest-all</AnalysisLevel>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<InformationalVersion>1.0.0-pre</InformationalVersion>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<PublishAot>false</PublishAot>
<RootNamespace>ptr727.ProjectTemplate.CodeGen</RootNamespace>
<TargetFramework>net10.0</TargetFramework>
<Version>1.0.0</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishAot)' == 'true'">
Expand All @@ -17,10 +12,10 @@
<VerifyReferenceAotCompatibility>true</VerifyReferenceAotCompatibility>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.4.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Serilog" Version="4.3.1" />
<PackageReference Include="System.CommandLine" Version="2.0.5" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" />
<PackageReference Include="Serilog.Enrichers.Thread" />
<PackageReference Include="Serilog.Sinks.Console" />
<PackageReference Include="Serilog" />
<PackageReference Include="System.CommandLine" />
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions CodeGen/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
global using System;
global using System.Collections.Frozen;
global using System.Globalization;
global using System.IO;
global using System.Linq;
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;
global using Serilog;
19 changes: 7 additions & 12 deletions Console/Console.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AnalysisLevel>latest-all</AnalysisLevel>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<InformationalVersion>1.0.0-pre</InformationalVersion>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<PublishAot>false</PublishAot>
<RootNamespace>ptr727.ProjectTemplate.Console</RootNamespace>
<TargetFramework>net10.0</TargetFramework>
<Version>1.0.0</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishAot)' == 'true'">
Expand All @@ -17,13 +12,13 @@
<VerifyReferenceAotCompatibility>true</VerifyReferenceAotCompatibility>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="Serilog" Version="4.3.1" />
<PackageReference Include="System.CommandLine" Version="2.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Serilog.Enrichers.Thread" />
<PackageReference Include="Serilog.Extensions.Logging" />
<PackageReference Include="Serilog.Sinks.Console" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Serilog" />
<PackageReference Include="System.CommandLine" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Library\Library.csproj" />
Expand Down
5 changes: 0 additions & 5 deletions Console/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
global using System;
global using System.Collections.Frozen;
global using System.Globalization;
global using System.IO;
global using System.Linq;
global using System.Threading;
global using System.Threading.Tasks;
global using Microsoft.Extensions.Logging;
global using Serilog;
global using Serilog.Events;
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AnalysisLevel>latest-all</AnalysisLevel>
<AnalysisMode>All</AnalysisMode>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ArtifactsPath>$(MSBuildThisFileDirectory).artifacts</ArtifactsPath>
<IsPackable>false</IsPackable>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
19 changes: 19 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>
<ItemGroup>
<PackageVersion Include="AwesomeAssertions" Version="9.4.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.4.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.201" />
<PackageVersion Include="Serilog" Version="4.3.1" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="10.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.5" />
<PackageVersion Include="xunit.analyzers" Version="1.27.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion Library/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
global using System;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Logging.Abstractions;
Loading
Loading