From 22d59df945de9bae1b146d42fb7e146904b8a59c Mon Sep 17 00:00:00 2001 From: Craig Treasure Date: Sat, 20 Dec 2025 13:16:22 -0800 Subject: [PATCH 1/4] Added Claude settings file --- .claude/settings.local.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..3e78b87 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,18 @@ +{ + "permissions": { + "allow": [ + "Edit", + "Bash(git checkout:*)", + "Bash(git add:*)", + "Bash(git commit:*)", + "Bash(dotnet list:*)", + "Bash(dotnet build:*)", + "Bash(dotnet test:*)", + "Bash(dotnet run:*)", + "Bash(dotnet test)", + "Bash(dotnet outdated)", + "Bash(dotnet sdk check:*)", + "Bash(curl:*)" + ] + } +} \ No newline at end of file From 0afe6f91f161dcbbcf4c74be37f19b18aa0e1a65 Mon Sep 17 00:00:00 2001 From: Craig Treasure Date: Sat, 20 Dec 2025 17:59:01 -0800 Subject: [PATCH 2/4] Upgrade NuGet packages and .NET tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update all direct NuGet package dependencies to their latest versions: - `Microsoft.Build.NoTargets`: 3.7.56 -> 3.7.134 - `Nerdbank.GitVersioning`: 3.7.115 -> 3.9.50 - `Microsoft.NET.Test.Sdk`: 17.14.1 -> 18.0.1 - `MSBuild.ProjectCreation`: 14.0.5 -> 17.0.1 - `xunit.runner.visualstudio`: 3.1.3 -> 3.1.5 - `nbgv` tool: 3.7.115 -> 3.9.50 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 8 ++++---- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 00b1f89..e7633c4 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "nbgv": { - "version": "3.7.115", + "version": "3.9.50", "commands": [ "nbgv" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index f554ba6..2292833 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -19,18 +19,18 @@ https://learn.microsoft.com/nuget/consume-packages/central-package-management#global-package-references --> - + - - + + - + diff --git a/global.json b/global.json index f721d2b..6fe1ea9 100644 --- a/global.json +++ b/global.json @@ -5,6 +5,6 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.Build.NoTargets": "3.7.56" + "Microsoft.Build.NoTargets": "3.7.134" } } \ No newline at end of file From 4cf3dea1dd9adddf089a227da095ed9ea5e2c2e2 Mon Sep 17 00:00:00 2001 From: Craig Treasure Date: Sat, 20 Dec 2025 18:11:46 -0800 Subject: [PATCH 3/4] add(documentation): Create CLAUDE.md for AI guidance Added CLAUDE.md to provide comprehensive guidance for AI agents working with the code in this repository. This document outlines project overview, build commands, project structure, key architecture details, testing approach, and versioning information to facilitate better understanding and usage of the SDK. --- CLAUDE.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..f714736 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,56 @@ +# CLAUDE.md + +This file provides guidance to AI agents when working with code in this repository. + +## Project Overview + +This repository contains `Treasure.Build.CentralBuildOutput`, an MSBuild project SDK that centralizes build output for .NET projects. Instead of placing `bin` and `obj` folders in each project directory, this SDK writes all build output to a common location with a tree structure mirroring the project structure. + +## Build Commands + +```shell +# Build the SDK +dotnet build + +# Run all tests +dotnet test + +# Run tests for a specific framework +dotnet test --framework net9.0 +``` + +## Project Structure + +- `src/CentralBuildOutput/` - The MSBuild SDK package (uses `Microsoft.Build.NoTargets`) + - `Sdk/Sdk.props` - Entry point props imported by consuming projects + - `Sdk/Sdk.targets` - Entry point targets that conditionally imports the appropriate configuration + - `Sdk/ConfigureBuildOutput.targets` - Core logic for redirecting build output paths + - `Sdk/ConfigureBuildOutputForArtifacts.targets` - Configuration when using .NET 8+ artifacts output +- `src/CentralBuildOutput.Tests/` - xUnit tests using `MSBuild.ProjectCreation` for in-memory MSBuild testing +- `samples/CentralBuildOutput/` - Sample projects demonstrating SDK usage +- `eng/` - Build infrastructure (analyzers, defaults, packaging configuration) + +## Key Architecture Details + +**SDK Entry Points**: The SDK uses standard MSBuild SDK conventions with `Sdk.props` and `Sdk.targets` files that get automatically imported when a project references the SDK. + +**Two Modes of Operation**: + +1. **Standard mode** (`ConfigureBuildOutput.targets`): Redirects `BaseIntermediateOutputPath`, `BaseOutputPath`, `OutputPath`, `PublishDir`, etc. to centralized folders prefixed with `__` (configurable via `CentralBuildOutputFolderPrefix`) +2. **Artifacts mode** (`ConfigureBuildOutputForArtifacts.targets`): When `UseArtifactsOutput=true`, defers to .NET 8+ artifacts output but still centralizes test results + +**Path Calculation**: The SDK calculates `RelativeProjectPath` by determining the relative path from `CentralBuildOutputPath` (or `CentralBuildOutputRelativeToPath` if set) to the project directory, preserving the folder hierarchy in output. + +**This Repo's Own Build**: Uses .NET 8+ artifacts output (`UseArtifactsOutput=true`) with `ArtifactsPath` set to `__artifacts`. + +## Testing Approach + +Tests use `MSBuild.ProjectCreation` to create in-memory MSBuild projects and verify that the SDK correctly sets output path properties. The test project copies SDK files to its output directory to enable testing. + +## Versioning + +Uses Nerdbank.GitVersioning for version management. + +## Coding style + +The project adheres to styles defined in `.editorconfig`. From 93ec9176159566309bcce3efceb8c1678f85caf1 Mon Sep 17 00:00:00 2001 From: Craig Treasure Date: Sat, 20 Dec 2025 18:13:39 -0800 Subject: [PATCH 4/4] add(documentation): Create AGENTS.md for AI guidance Renamed CLAUDE.md to AGENTS.md and included AGENTS.md from within CLAUDE.md. --- AGENTS.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ CLAUDE.md | 57 +------------------------------------------------------ 2 files changed, 57 insertions(+), 56 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..f714736 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,56 @@ +# CLAUDE.md + +This file provides guidance to AI agents when working with code in this repository. + +## Project Overview + +This repository contains `Treasure.Build.CentralBuildOutput`, an MSBuild project SDK that centralizes build output for .NET projects. Instead of placing `bin` and `obj` folders in each project directory, this SDK writes all build output to a common location with a tree structure mirroring the project structure. + +## Build Commands + +```shell +# Build the SDK +dotnet build + +# Run all tests +dotnet test + +# Run tests for a specific framework +dotnet test --framework net9.0 +``` + +## Project Structure + +- `src/CentralBuildOutput/` - The MSBuild SDK package (uses `Microsoft.Build.NoTargets`) + - `Sdk/Sdk.props` - Entry point props imported by consuming projects + - `Sdk/Sdk.targets` - Entry point targets that conditionally imports the appropriate configuration + - `Sdk/ConfigureBuildOutput.targets` - Core logic for redirecting build output paths + - `Sdk/ConfigureBuildOutputForArtifacts.targets` - Configuration when using .NET 8+ artifacts output +- `src/CentralBuildOutput.Tests/` - xUnit tests using `MSBuild.ProjectCreation` for in-memory MSBuild testing +- `samples/CentralBuildOutput/` - Sample projects demonstrating SDK usage +- `eng/` - Build infrastructure (analyzers, defaults, packaging configuration) + +## Key Architecture Details + +**SDK Entry Points**: The SDK uses standard MSBuild SDK conventions with `Sdk.props` and `Sdk.targets` files that get automatically imported when a project references the SDK. + +**Two Modes of Operation**: + +1. **Standard mode** (`ConfigureBuildOutput.targets`): Redirects `BaseIntermediateOutputPath`, `BaseOutputPath`, `OutputPath`, `PublishDir`, etc. to centralized folders prefixed with `__` (configurable via `CentralBuildOutputFolderPrefix`) +2. **Artifacts mode** (`ConfigureBuildOutputForArtifacts.targets`): When `UseArtifactsOutput=true`, defers to .NET 8+ artifacts output but still centralizes test results + +**Path Calculation**: The SDK calculates `RelativeProjectPath` by determining the relative path from `CentralBuildOutputPath` (or `CentralBuildOutputRelativeToPath` if set) to the project directory, preserving the folder hierarchy in output. + +**This Repo's Own Build**: Uses .NET 8+ artifacts output (`UseArtifactsOutput=true`) with `ArtifactsPath` set to `__artifacts`. + +## Testing Approach + +Tests use `MSBuild.ProjectCreation` to create in-memory MSBuild projects and verify that the SDK correctly sets output path properties. The test project copies SDK files to its output directory to enable testing. + +## Versioning + +Uses Nerdbank.GitVersioning for version management. + +## Coding style + +The project adheres to styles defined in `.editorconfig`. diff --git a/CLAUDE.md b/CLAUDE.md index f714736..43c994c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,56 +1 @@ -# CLAUDE.md - -This file provides guidance to AI agents when working with code in this repository. - -## Project Overview - -This repository contains `Treasure.Build.CentralBuildOutput`, an MSBuild project SDK that centralizes build output for .NET projects. Instead of placing `bin` and `obj` folders in each project directory, this SDK writes all build output to a common location with a tree structure mirroring the project structure. - -## Build Commands - -```shell -# Build the SDK -dotnet build - -# Run all tests -dotnet test - -# Run tests for a specific framework -dotnet test --framework net9.0 -``` - -## Project Structure - -- `src/CentralBuildOutput/` - The MSBuild SDK package (uses `Microsoft.Build.NoTargets`) - - `Sdk/Sdk.props` - Entry point props imported by consuming projects - - `Sdk/Sdk.targets` - Entry point targets that conditionally imports the appropriate configuration - - `Sdk/ConfigureBuildOutput.targets` - Core logic for redirecting build output paths - - `Sdk/ConfigureBuildOutputForArtifacts.targets` - Configuration when using .NET 8+ artifacts output -- `src/CentralBuildOutput.Tests/` - xUnit tests using `MSBuild.ProjectCreation` for in-memory MSBuild testing -- `samples/CentralBuildOutput/` - Sample projects demonstrating SDK usage -- `eng/` - Build infrastructure (analyzers, defaults, packaging configuration) - -## Key Architecture Details - -**SDK Entry Points**: The SDK uses standard MSBuild SDK conventions with `Sdk.props` and `Sdk.targets` files that get automatically imported when a project references the SDK. - -**Two Modes of Operation**: - -1. **Standard mode** (`ConfigureBuildOutput.targets`): Redirects `BaseIntermediateOutputPath`, `BaseOutputPath`, `OutputPath`, `PublishDir`, etc. to centralized folders prefixed with `__` (configurable via `CentralBuildOutputFolderPrefix`) -2. **Artifacts mode** (`ConfigureBuildOutputForArtifacts.targets`): When `UseArtifactsOutput=true`, defers to .NET 8+ artifacts output but still centralizes test results - -**Path Calculation**: The SDK calculates `RelativeProjectPath` by determining the relative path from `CentralBuildOutputPath` (or `CentralBuildOutputRelativeToPath` if set) to the project directory, preserving the folder hierarchy in output. - -**This Repo's Own Build**: Uses .NET 8+ artifacts output (`UseArtifactsOutput=true`) with `ArtifactsPath` set to `__artifacts`. - -## Testing Approach - -Tests use `MSBuild.ProjectCreation` to create in-memory MSBuild projects and verify that the SDK correctly sets output path properties. The test project copies SDK files to its output directory to enable testing. - -## Versioning - -Uses Nerdbank.GitVersioning for version management. - -## Coding style - -The project adheres to styles defined in `.editorconfig`. +@AGENTS.md