Skip to content

Latest commit

 

History

History
102 lines (67 loc) · 5.34 KB

README.md

File metadata and controls

102 lines (67 loc) · 5.34 KB

Dev notes

Building

Building with Visual Studio

  1. Clone the repo and open the DotNet.Sdk.Extensions.sln solution file at the root.
  2. Press build on Visual Studio.

Building with dotnet CLI

  1. Clone the repo and browse to the root directory of the repo using your favorite shell.
  2. Run dotnet build DotNet.Sdk.Extensions.sln to build the source for the extensions.

Running tests

The test projects run against multiple frameworks and the workflow to build and test the solution runs both on Linux and on Windows.

Note

Some tests run a test server with an HTTPS URL so you have to run the following command to trust developer certificates:

dotnet dev-certs https --trust

For more info see Generate self-signed certificates with the .NET CLI.

Run tests with Visual Studio

  1. Clone the repo and open the DotNet.Sdk.Extensions.sln solution file at the root.
  2. Go to the test explorer in Visual Studio and run tests.

Note: Remote testing with WSL is configured on the solution which enables you to run the tests locally on Linux via WSL or Docker. You can view the configuration file at testenvironments.json.

To run tests via WSL you need to have at least Visual Studio 2022 and the Linux distro Ubuntu-20.04 installed on WSL.

Run tests with dotnet CLI

  1. Clone the repo and browse to the root directory of the repo using your favorite shell.
  2. Run dotnet test DotNet.Sdk.Extensions.sln to run tests.

Projects wide configuration

  • The Directory.Build.props enables several settings as well as adds some common NuGet packages for all projects.

  • There is a set of NuGet packages that are only applied in test projects by using the condition "'$(IsTestProject)' == 'true'". To make this work the csproj for the test projects must have the <IsTestProject>true</IsTestProject> property defined. Adding this property manually shouldn't be needed because it should be added by the Microsoft.NET.Test.Sdk package however there seems to be an issue with this when running tests outside of Visual Studio. See this GitHub issue for more info.

  • When running dotnet CLI commands make sure you are at the root of the repo so that the global.json is respected. If you don't you might get unexpected results when building the solution. As explained in global.json overview:

The .NET SDK looks for a global.json file in the current working directory (which isn't necessarily the same as the project directory) or one of its parent directories.

Deterministic Build configuration

Following the guide from Deterministic Builds the ContinuousIntegrationBuild setting on the Directory.Build.props is set to true, if the build is being executed in GitHub actions.

Source Link configuration

Following the guide from Source Link the following settings are configured to enable creating Nuget libraries that provide source debugging:

  • PublishRepositoryUrl
  • EmbedUntrackedSources
  • IncludeSymbols
  • SymbolPackageFormat

These values are configured on the projects that produce NuGet packages:

In addition, as per the documentation, both the above projects include the Microsoft.SourceLink.GitHub NuGet.

Repository configuration

From all the GitHub repository settings the configurations worth mentioning are:

  • Automatically delete head branches is enabled: after pull requests are merged, head branches are deleted automatically.
  • Branch protection rules. There is a branch protection rule for the the main branch that will enforce the following:
    • Require status checks to pass before merging.
    • Require branches to be up to date before merging.
    • Require linear history.

GitHub Workflows

For more information about the GitHub workflows configured for this repo go here.

Release NuGet package

To release a new version of the NuGet packages follow the process described in NuGet release flow.