diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 6667feadfe7e..000000000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,44 +0,0 @@ -Use the instructions from the main branch if available: @dotnet/sdk/files/.github/copilot-instructions.md - -If the instructions from main are not available, use the following as a fallback: - -Coding Style and Changes: -- Code should match the style of the file it's in. -- Changes should be minimal to resolve a problem in a clean way. -- User-visible changes to behavior should be considered carefully before committing. They should always be flagged. -- Only edit the files that are necessary to address the specific issue. Do not run `dotnet format` or make formatting changes to additional files. -- Prefer using file-based namespaces for new code. -- Do not allow unused `using` directives to be committed. -- Use `#if NET` blocks for .NET Core specific code, and `#if NETFRAMEWORK` for .NET Framework specific code. - -Testing: -- Large changes should always include test changes. -- When creating new test projects in test/TestAssets/TestProjects, always use `$(CurrentTargetFramework)` for the `` property instead of hard-coding a specific version like `net8.0`. -- The Skip parameter of the Fact attribute to point to the specific issue link. -- To run tests in this repo: - - Use the repo-local dotnet instance: `./.dotnet/dotnet` - - For MSTest-style projects: `dotnet test path/to/project.csproj --filter "FullyQualifiedName~TestName"` - - For XUnit test assemblies: `dotnet exec artifacts/bin/redist/Debug/TestAssembly.dll -method "*TestMethodName*"` - - Examples: - - `dotnet test test/dotnet.Tests/dotnet.Tests.csproj --filter "Name~ItShowsTheAppropriateMessageToTheUser"` - - `dotnet exec artifacts/bin/redist/Debug/dotnet.Tests.dll -method "*ItShowsTheAppropriateMessageToTheUser*"` -- To test CLI command changes: - - Build the redist SDK: `./build.sh` from repo root - - Create a dogfood environment: `source eng/dogfood.sh` - - Test commands in the dogfood shell (e.g., `dnx --help`, `dotnet tool install --help`) - - The dogfood script sets up PATH and environment to use the newly built SDK - -Output Considerations: -- When considering how output should look, solicit advice from baronfel. - -Localization: -- Avoid modifying .xlf files and instead prompt the user to update them using the `/t:UpdateXlf` target on MSBuild. Correctly automatically modified .xlf files have elements with state `needs-review-translation` or `new`. -- Consider localizing strings in .resx files when possible. - -Documentation: -- Do not manually edit files under documentation/manpages/sdk as these are generated based on documentation and should not be manually modified. - -External Dependencies: -- Changes that require modifications to the dotnet/templating repository (Microsoft.TemplateEngine packages) should be made directly in that repository, not worked around in this repo. -- The dotnet/templating repository owns the TemplateEngine.Edge, TemplateEngine.Abstractions, and related packages. -- If a change requires updates to template engine behavior or formatting (e.g., DisplayName properties), file an issue in dotnet/templating and make the changes there rather than adding workarounds in this SDK repository. diff --git a/.github/skills b/.github/skills deleted file mode 120000 index 9af1c1454ae3..000000000000 --- a/.github/skills +++ /dev/null @@ -1 +0,0 @@ -D:/code/dotnet-sdk/.claude/skills/ \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000000..44efbe614240 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,56 @@ +# dotnet/sdk Repo Overview + +This is the .NET SDK repo. +It contains the `dotnet` CLI, MSBuild tasks/targets, project system SDKs, template engine, workload management, and related tooling. +This repo uses https://github.com/dotnet/arcade for build, test, and pipeline infrastructure. + +## Local Development Workflow + +Use the `.dotnet/dotnet` executable for `dotnet` CLI commands. +It is automatically acquired during the build process. +Do not modify the SDK version specified in `global.json`. + +### Build + +- Linux/macOS: `./build.sh` +- Windows: `build.cmd` + +Useful flags: + +- `-bl` - Generate binlog +- `-v ` - verbosity: q[uiet], m[inimal], n[ormal], d[etailed], diag[nostic] +- `/p:SomeProperty=value` - Set MSBuild property + +The newly built .NET CLI is output to `artifacts/bin/redist/Debug/dotnet/dotnet`. +It can be used to sanity check local changes in a temp directory. + +### Test + +Do not run the full test suite locally, it takes hours. +Instead, run only the tests relevant to your changes. + +After building, run individual test projects: + +```bash +# Run all tests in a specific test project +./.dotnet/dotnet test test/.Tests + +# Run a single test by name +./.dotnet/dotnet test test/.Tests --filter "FullyQualifiedName~TestMethodName" + +# Run a single test by class +./.dotnet/dotnet test test/.Tests --filter "ClassName=Microsoft.DotNet.Cli.SomeTests" +``` + +Test projects live in `test/.Tests` and `test/.IntegrationTests` (with one exception: `NetAnalyzers` tests live in `src/Microsoft.CodeAnalysis.NetAnalyzers/tests`). + +## Project Layout + +| Feature | Location | +|---|---| +| `dotnet` CLI (entry point & commands) | `src/Cli/` | +| Template content | `template_feed/` | +| Build infrastructure | `eng/` | +| Arcade infrastructure (do not edit) | `eng/common` | +| Distributed test orchestration via Helix | `test/UnitTests.proj` | +| Developer documentation | `documentation/` |