diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b55b2ae3..e3e1c7b1d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,119 +1,120 @@ # C#/WinRT Contributor's Guide -Below is our guidance for how to build the repo, report issues, propose new features, and submit contributions via Pull Requests (PRs). +This guide explains how to report issues, propose features, build the repository, and submit PRs. -## Building the C#/WinRT repo +1. [Find or File an Issue First](#find-or-file-an-issue-first) +2. [Working on a Fix or Feature After Approvals](#working-on-a-fix-or-feature-after-approvals) +3. [Building the repo](#building-the-repo) -C#/WinRT currently requires the following packages, or newer, to build: +## Find or File an Issue First -- [Visual Studio 17.0](https://visualstudio.microsoft.com/downloads/) -- [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) -- [nuget.exe 5.8.0-preview.3](https://www.nuget.org/downloads) -- Microsoft.WinUI 3.0.0-preview4.210210.4 -- Microsoft.WindowsAppSDK 1.1.5 +Before starting any work to submit a PR, **find or file an issue first**. This ensures no duplicated effort and keeps collaboration efficient. -The [`build.cmd`](src/build.cmd) script takes care of all related configuration steps and is the simplest way to get started building C#/WinRT. It installs prerequisites such as `nuget.exe` and the .NET 6 SDK, configures the environment to use .NET 6 (creating a `global.json` if necessary), builds the compiler, and builds and executes the unit tests. To build C#/WinRT, follow these steps: +Check both open and closed issues before filing a new one. If none matches your case, file a new issue. -- Open a Visual Studio Developer command prompt pointing at the repo. -- Run `src\build.cmd`. -- To launch the project in Visual Studio, run `devenv src\cswinrt.sln` from the same command prompt. This will inherit the necessary environment. +### When to File an Issue -**Note:** By default, the projects for various [Projections](src/Projections) only generate source files for Release configurations, where `cswinrt.exe` can execute in seconds. To generate sources for the [Projections](src/Projections) projects on Debug configurations, set the project property `GenerateTestProjection` to `true`. This configuration permits a faster inner loop in Visual Studio. In either case, existing projection sources under the "Generated Files" folder will still be compiled into the projection assembly. +* Unsure if it’s a bug or feature request + * → [File an Issue](https://github.com/microsoft/CsWinRT/issues/new/choose) +* Have a question not answered in the docs + * → [Post a Discussion](https://github.com/microsoft/CsWinRT/discussions) +* Want to propose or confirm a planned feature + * → [Post a Discussion](https://github.com/microsoft/CsWinRT/discussions) -### Customizing `build.cmd` options - -There are several settings that can be set with `build.cmd` that you might not know about without studying the code. The build settings and defaults are as follows. - -```cmd -build.cmd [Platform] [Configuration] [VersionNumber] [VersionString] [AssemblyVersion] -``` +### What to Describe -| Parameter | Value(s) | -|-|-| -| Platform | *x64 \| x86 | Default is `x64` -| Configuration | *Release \| Debug | -| VersionNumber | *0.0.0.0 | -| VersionString | *0.0.0-private.0 | -| AssemblyVersion | *0.0.0.0 | -\*Default value +* Versions of .NET, C#/WinRT, and SDK projections +* Tools and IDEs used (e.g., VS 2022, VS Code) +* Build version of Windows used +* **Detailed reproduction steps** (most important) +* Full error text or screenshots +* Note if you plan to implement the fix/feature yourself -**Examples** +> [!IMPORTANT] +> **DO NOT** post "+1", "me too", or similar comments ー they just add noise to an issue. +> If you don't have any additional info/context to add but would like to indicate that you're affected by the issue, upvote the original issue by reacting with 😊 or 👍 (+1) emoji and post your context if necessary. This way we can actually measure how impactful an issue is. -- Building in Release mode for platform x64, and creates a 0.0.0-private.0.nupkg - ```cmd - build.cmd - ``` -- Building in Debug mode for platform x86, and creates a 0.0.0-private.0.nupkg - ```cmd - build.cmd x86 Debug - ``` -- Building in Debug mode for platform x64, and creates a 2.0.0-mycswinrt.0.nupkg that has `WinRT.Runtime` with AssemblyVersion of 2.0.0.0 - ```cmd - build.cmd x64 Debug 2.0.0.0 2.0.0-mycswinrt.0 2.0.0.0 - ``` - This is useful if you want to quickly confirm that your private .nupkg is being used by checking the `WinRT.Runtime` assembly version. +## Working on a Fix or Feature After Approvals -## Before you start, file an issue +### 1. Fork and Branch -Please follow this simple rule to help us eliminate any unnecessary wasted effort & frustration, and ensure an efficient and effective use of everyone's time - yours, ours, and other community members': +After your proposal is discussed and approved: -> 👉 If you have a question, think you've discovered an issue, would like to propose a new feature, etc., then find/file an issue **BEFORE** starting work to fix/implement it. +1. Fork the repo +2. Clone your fork +3. Create and push a feature branch +4. Implement your changes +5. Test your changes on your local +6. Submit a Pull Request (PR) -### Search Existing Issues First +### 2. Agree with CLA -Before filing a new issue, search existing open and closed issues first: It is likely someone else has found the problem you're seeing, and someone may be working on or have already contributed a fix! +Most contributions require signing a [Contributor License Agreement (CLA)](https://cla.opensource.microsoft.com), confirming that you own the rights to your contribution and grant Microsoft permission to use it. -If no existing item describes your issue/feature, great - please file a new issue: +When you open a pull request, the CLA bot automatically checks whether a signature is required and updates the PR with a status or comment. +Follow the bot’s instructions if prompted. You only need to complete this process once for all Microsoft repositories that use the CLA bot. -### File a New Issue +### 3. Code Review -* Don't know whether you're reporting an issue or requesting a feature? File an issue -* Have a question that you don't see answered in docs, videos, etc.? File an issue -* Want to know if we're planning on building a particular feature? File an issue -* Found an existing issue that describes yours? Great - upvote and add additional commentary / info / repro-steps / etc. +Mark your PR as "Ready for Review" when it’s ready for feedback from the team and the community. It may take several review cycles to ensure correctness and stability. -### Include Issue Details +### 4. Merge -**Please include as much information as possible in your issue**. The more information you provide, the more likely your issue/ask will be understood and implemented. Helpful information includes: +After approvals, your PR will be merged into the main branch and automatically closed. -* What versions of .NET, C#/WinRT, and the SDK Projection you're using -* What tools and apps you're using (e.g. VS 2019, VSCode, etc.) -* What build of Windows your device is running -* Don't assume we're experts in setting up YOUR environment and don't assume we are experts in YOUR workflow. Teach us to help you! -* **We LOVE detailed repro steps!** What steps do we need to take to reproduce the issue? Assume we love to read repro steps. As much detail as you can stand is probably _barely_ enough detail for us! -* Prefer error message text where possible or screenshots of errors if text cannot be captured -* **If you intend to implement the fix/feature yourself then say so!** If you do not indicate otherwise we will assume that the issue is ours to solve, or may label the issue as `Help-Wanted`. +Thank you in advance for your contribution! -### DO NOT post "+1" comments +## Building the repo -> ⚠ DO NOT post "+1", "me too", or similar comments - they just add noise to an issue. +### Prerequisites -If you don't have any additional info/context to add but would like to indicate that you're affected by the issue, upvote the original issue by clicking its [+😊] button and hitting 👍 (+1) icon. This way we can actually measure how impactful an issue is. +- [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) +- [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet) ---- +### Build steps -## Development - -### Fork, Clone, Branch and Create your PR +1. Open a Visual Studio Developer command prompt in the repo root. +2. Run a script to install dependencies, set up the environment, build the compiler, and run unit tests. + ``` + src\build.cmd + ``` +3. (Optional) Open the solution in Visual Studio. This will inherit the necessary environment. + ``` + devenv src\cswinrt.sln + ``` -Once you've discussed your proposed feature/fix/etc. with a team member, and you've agreed on an approach or a spec has been written and approved, it's time to start development: +> [!NOTE] +> Projection projects under `src/Projections` only generate sources in `Release` by default. To generate them in `Debug`, set the property `GenerateTestProjection` to `true`. This configuration will enable a faster inner loop in Visual Studio. "Generated Files" remain under the Generated Files folder regardless of configuration. -1. Fork the repo if you haven't already -1. Clone your fork locally -1. Create & push a feature branch -1. Create a Pull Request -1. Work on your changes +### Customizing `build.cmd` options -### Code Review +You can specify platform, configuration, and version parameters: -When you'd like the team to take a look, (even if the work is not yet fully complete), mark the PR as 'Ready For Review' so that the team can review your work and provide comments, suggestions, and request changes. It may take several cycles, but the end result will be solid, testable, conformant code that is safe for us to merge. +```cmd +build.cmd [Platform] [Configuration] [VersionNumber] [VersionString] [AssemblyVersion] +``` -### Merge +| Parameter | Values | Default +|-|-|-| +| Platform | `x64 \| x86` | `x64` | +| Configuration | `Release \| Debug` | `Release` | +| VersionNumber | \* | `0.0.0.0` | +| VersionString | \* | `0.0.0-private.0` | +| AssemblyVersion |\* | `0.0.0.0` | -Once your code has been reviewed and approved by the requisite number of team members, it will be merged into the master branch. Once merged, your PR will be automatically closed. +Building in `Release` for `x64`, and creates `0.0.0-private.0.nupkg` +```cmd +build.cmd +``` ---- +Building in `Debug` for `x86`, and creates `0.0.0-private.0.nupkg` +```cmd +build.cmd x86 Debug +``` -## Thank you +Building in `Debug` for `x64`, and creates `2.0.0-mycswinrt.0.nupkg` that has `WinRT.Runtime` with AssemblyVersion of `2.0.0.0` +```cmd +build.cmd x64 Debug 2.0.0.0 2.0.0-mycswinrt.0 2.0.0.0 +``` -Thank you in advance for your contribution! +This is useful if you want to quickly confirm that your private .nupkg is being used by checking the `WinRT.Runtime` assembly version. diff --git a/README.md b/README.md index a34d5c881..0903c5e81 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,40 @@ -[](https://dev.azure.com/microsoft/Dart/_build/latest?definitionId=112455&branchName=master) +
+
+
+