Skip to content

Commit a948499

Browse files
committed
Updated README.md, plus make NodeJS/Docker optional
1 parent 963bc69 commit a948499

File tree

8 files changed

+52
-23
lines changed

8 files changed

+52
-23
lines changed

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,53 @@ To open an issue for this project, please visit the [core xUnit.net project issu
66

77
## Building and Contribution
88

9-
This site is built with Jekyll, which is based on Ruby, as this is the default system used by GitHub Pages. We use a C#-based build system.
9+
This site is built with DocFX. We use a C#-based build system.
1010

1111
### Build prerequisites
1212

1313
In order to successfully build and view the content locally, you will need the following pre-requisites:
1414

1515
* [.NET SDK 9 or later](https://dotnet.microsoft.com/download/dotnet/)
16-
* [NodeJS 22 or later](https://nodejs.org/) for live content rebuild during development
17-
* [Docker](https://docs.docker.com/engine/install/) to host nginx during development
16+
17+
If you wish to use `./build serve` for live regeneration during development, you will also need:
18+
19+
* [NodeJS 22 or later](https://nodejs.org/) (for the live rebuild monitoring)
20+
* [Docker](https://docs.docker.com/engine/install/) (to host nginx)
1821

1922
### Editing the site pages
2023

2124
The site content lives in [`/site`](https://github.com/xunit/xunit.net/tree/main/site) and the output will placed in `/.site`. To build the static content, run the command `./build` from the root of your clone, via your command prompt (bash and PowerShell are supported). This will do a one-time transformation of the templates in `/site` to the static files in `/.site`.
2225

23-
For working interactively, you can run `./build serve` which will start Jekyll in a mode where it incrementally builds the site as needed, and will rebuild pages as you change the files. You can point your browser to [http://localhost:4000/](http://localhost:4000/) while the server is running to view the rendered content. Once you're finished, you can press Ctrl+C in the command prompt and the server will shut down.
24-
25-
_Note: if you see a warning about `Auto-regeneration may not work on some Windows versions` and you're running in WSL 2, you may safely ignore this. Auto-regeneration works in WSL 2 without issue, and the warning is based on some very early WSL 1 bugs with file system watchers._
26+
For working interactively, you can run `./build serve` which will use NodeJS to run in a mode where it simultaneously builds the site and uses a Docker-based nginx server to serve the static content. It will automatically rebuild the site as you change the site's content files. You can point your browser to [http://127.0.0.1:4000/](http://127.0.0.1:4000/) while the server is running to view the rendered content. Once you're finished, you can press Ctrl+C in the command prompt and the server will shut down. (You may need to press Ctrl+C more than once on Windows.)
2627

2728
Text editors/IDEs which understand site hierarchy and linking while editing Markdown and HTML are strongly encouraged to open the `/site` folder and not the root folder when editing content, so that the editor understands where the content root lives. _For example, if you're using VSCode, you should run `code site` and not `code .` from the root of the repo._ You should only ever need to open the root of the repo in your editor if you're working on the build tools.
2829

29-
### Editing analyzer rule documentation
30+
# About xUnit.net
3031

31-
The analyzer rules are does as Markdown templates that live in [`/site/xunit.analyzers/_rules`](site/xunit.analyzers/_rules) and are rendered dynamically into [`/site/xunit.analyzers/_rules`](site/xunit.analyzers/rules).
32+
xUnit.net is a free, open source, community-focused unit testing tool for C#, F#, and Visual Basic.
3233

33-
The standard template for creating documentation for a new rule lives in [`/site/xunit.analyzers/_rules/_stub.md`](site/xunit.analyzers/_rules/_stub.md). Copy this file and name it to match the analyzer ID (note: these are case-sensitive, so they should always have names like `xUnit0000.md` where `0000` is the rule number). Fill out the document header and contents, and ensure the rule shows up in the [Analyzer Rules](http://localhost:4000/xunit.analyzers/rules) home page. Ensure that the page renders properly, as you may need to quote values in the header if they contain characters that Jekyll does not to process when running the template engine. You can use an existing documentation page to understand what an analyzer documentation page should look like.
34+
xUnit.net works with the [.NET SDK](https://dotnet.microsoft.com/download) command line tools, [Visual Studio](https://visualstudio.microsoft.com/), [Visual Studio Code](https://code.visualstudio.com/), [JetBrains Rider](https://www.jetbrains.com/rider/), [NCrunch](https://www.ncrunch.net/), and any development environment compatible with [Microsoft Testing Platform](https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-intro) (xUnit.net v3) or [VSTest](https://github.com/microsoft/vstest) (all versions of xUnit.net).
3435

35-
# About xUnit.net
36+
xUnit.net is part of the [.NET Foundation](https://www.dotnetfoundation.org/) and operates under their [code of conduct](https://www.dotnetfoundation.org/code-of-conduct). It is licensed under [Apache 2](https://opensource.org/licenses/Apache-2.0) (an OSI approved license). The project is [governed](https://xunit.net/governance) by a Project Lead.
3637

37-
[<img align="right" src="https://xunit.net/images/dotnet-fdn-logo.png" width="100" />](https://www.dotnetfoundation.org/)
38+
For project documentation, please visit the [xUnit.net project home](https://xunit.net/).
3839

39-
xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework. Written by the original inventor of NUnit v2, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. xUnit.net works with ReSharper, CodeRush, TestDriven.NET and Xamarin. It is part of the [.NET Foundation](https://www.dotnetfoundation.org/), and operates under their [code of conduct](https://dotnetfoundation.org/about/policies/code-of-conduct). It is licensed under [Apache 2](https://opensource.org/licenses/Apache-2.0) (an OSI approved license).
40+
* _New to xUnit.net? Get started with the [.NET SDK](https://xunit.net/docs/getting-started/v3/getting-started)._
41+
* _Need some help building the source? See [BUILDING.md](https://github.com/xunit/xunit/tree/main/BUILDING.md)._
42+
* _Want to contribute to the project? See [CONTRIBUTING.md](https://github.com/xunit/.github/tree/main/CONTRIBUTING.md)._
43+
* _Want to contribute to the assertion library? See the [suggested contribution workflow](https://github.com/xunit/assert.xunit/tree/main/README.md#suggested-contribution-workflow) in the assertion library project, as it is slightly more complex due to code being spread across two GitHub repositories._
4044

41-
For project documentation, please visit the [xUnit.net project home](https://xunit.net/).
45+
## Latest Builds
46+
47+
| | Latest stable | Latest CI ([how to use](https://xunit.net/docs/using-ci-builds)) | Build status
48+
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------
49+
| `xunit.v3` | [![](https://img.shields.io/nuget/v/xunit.v3.svg?logo=nuget)](https://www.nuget.org/packages/xunit.v3) | [![](https://img.shields.io/badge/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit.v3/latest&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit.v3) | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/xunit/badge%3Fref%3Dmain&amp;label=build)](https://actions-badge.atrox.dev/xunit/xunit/goto?ref=main)
50+
| `xunit` | [![](https://img.shields.io/nuget/v/xunit.svg?logo=nuget)](https://www.nuget.org/packages/xunit) | [![](https://img.shields.io/badge/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit/latest&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit) | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/xunit/badge%3Fref%3Dv2&amp;label=build)](https://actions-badge.atrox.dev/xunit/xunit/goto?ref=v2)
51+
| `xunit.analyzers` | [![](https://img.shields.io/nuget/v/xunit.analyzers.svg?logo=nuget)](https://www.nuget.org/packages/xunit.analyzers) | [![](https://img.shields.io/badge/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit.analyzers/latest&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit.analyzers) | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/xunit.analyzers/badge%3Fref%3Dmain&amp;label=build)](https://actions-badge.atrox.dev/xunit/xunit.analyzers/goto?ref=main)
52+
| `xunit.runner.visualstudio` | [![](https://img.shields.io/nuget/v/xunit.runner.visualstudio.svg?logo=nuget)](https://www.nuget.org/packages/xunit.runner.visualstudio) | [![](https://img.shields.io/badge/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit.runner.visualstudio/latest&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit.runner.visualstudio) | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/visualstudio.xunit/badge%3Fref%3Dmain&amp;label=build)](https://actions-badge.atrox.dev/xunit/visualstudio.xunit/goto?ref=main)
53+
54+
*For complete CI package lists, please visit the [feedz.io package search](https://feedz.io/org/xunit/repository/xunit/search). A free login is required.*
55+
56+
## Sponsors
57+
58+
Help support this project by becoming a sponsor through [GitHub Sponsors](https://github.com/sponsors/xunit).

build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ function guard_bin {
1212

1313
guard_bin git "please install the Git CLI from https://git-scm.com/"
1414
guard_bin dotnet "please install the .NET SDK from https://dot.net/"
15-
guard_bin node "please install NodeJS from https://nodejs.org/"
1615

1716
[ $(dotnet --version | cut -d. -f1) -ge 9 ] || write_error ".NET SDK version $(dotnet --version) is too low; please install version 9.0 from https://dot.net/"
1817

build.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function GuardBin {
1717

1818
GuardBin git "please install the Git CLI from https://git-scm.com/"
1919
GuardBin dotnet "please install the .NET SDK from https://dot.net/"
20-
GuardBin node "please install NodeJS from https://nodejs.org/"
2120

2221
$version = [Version]$([regex]::matches((&dotnet --version), '^(\d+\.)?(\d+\.)?(\*|\d+)').value)
2322
if ($version.Major -lt 9) {

tools/builder/models/BuildTarget.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace Xunit.BuildTools.Models;
33
public class BuildTarget
44
{
55
public const string Build = nameof(Build);
6-
public const string Restore = nameof(Restore);
6+
public const string RestoreDotNet = nameof(RestoreDotNet);
7+
public const string RestoreNode = nameof(RestoreNode);
78
public const string Serve = nameof(Serve);
89
}

tools/builder/targets/Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Xunit.BuildTools.Targets;
55

66
[Target(
77
BuildTarget.Build,
8-
BuildTarget.Restore
8+
BuildTarget.RestoreDotNet
99
)]
1010
public static class Build
1111
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Threading.Tasks;
2+
using Xunit.BuildTools.Models;
3+
4+
namespace Xunit.BuildTools.Targets;
5+
6+
[Target(BuildTarget.RestoreDotNet)]
7+
public static partial class RestoreDotNet
8+
{
9+
public static async Task OnExecute(BuildContext context)
10+
{
11+
context.BuildStep("Restoring .NET build environment");
12+
13+
await context.Exec("dotnet", "tool restore");
14+
}
15+
}
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
namespace Xunit.BuildTools.Targets;
66

7-
[Target(BuildTarget.Restore)]
8-
public static partial class RestoreTools
7+
[Target(BuildTarget.RestoreNode)]
8+
public static partial class RestoreNode
99
{
1010
public static async Task OnExecute(BuildContext context)
1111
{
12-
context.BuildStep("Restoring build environment");
13-
14-
await context.Exec("dotnet", "tool restore");
12+
context.BuildStep("Restoring NodeJS build environment");
1513

1614
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
1715
await context.Exec("cmd", "/c npm install --no-fund");

tools/builder/targets/Serve.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Xunit.BuildTools.Targets;
77

88
[Target(
99
BuildTarget.Serve,
10-
BuildTarget.Restore
10+
BuildTarget.RestoreDotNet, BuildTarget.RestoreNode
1111
)]
1212
public static class Serve
1313
{

0 commit comments

Comments
 (0)