Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fallout.cli": {
"version": "11.0.18",
"commands": [
"fallout"
]
}
}
}
15 changes: 11 additions & 4 deletions .nuke/build.schema.json → .fallout/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"Quiet"
]
},
"NukeBuild": {
"FalloutBuild": {
"properties": {
"Continue": {
"type": "boolean",
Expand Down Expand Up @@ -102,6 +102,13 @@
"Verbosity": {
"description": "Logging verbosity during build execution. Default is 'Normal'",
"$ref": "#/definitions/Verbosity"
},
"BuildProjectFile": {
"type": [
"null",
"string"
],
"description": "Path to the build project (.csproj) relative to the repository root. Defaults to 'build/_build.csproj' when unset. Read by the Fallout global tool's in-tool runner."
}
}
}
Expand All @@ -115,11 +122,11 @@
},
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
],
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)"
},
"ReleaseNotesFilePath": {
"type": "string",
Expand All @@ -132,7 +139,7 @@
}
},
{
"$ref": "#/definitions/NukeBuild"
"$ref": "#/definitions/FalloutBuild"
}
]
}
File renamed without changes.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
id: check_job
run: |
echo "value: ${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
echo "::set-output name=value::${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
echo "value=${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}" >> "$GITHUB_OUTPUT"

documentation:
needs: [can_document]
runs-on: ubuntu-latest
if: needs.can_document.outputs.value == 'true'

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v7
with:
node-version: "20.x"
registry-url: 'https://registry.npmjs.org'
Expand All @@ -48,9 +48,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7

- uses: actions/setup-dotnet@v5
- uses: actions/setup-dotnet@v6
with:
dotnet-version: |
10.0.x
Expand All @@ -62,9 +62,9 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7

- uses: actions/setup-dotnet@v5
- uses: actions/setup-dotnet@v6
with:
dotnet-version: |
10.0.x
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ pip-log.txt
# Mac crap
.DS_Store

# Nuke build tool
.nuke/temp
# Fallout build tool
.fallout/temp
9 changes: 6 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ over AngleSharp's `[DomName]`-style attributes.

## Commands

The orchestrator is NUKE (`nuke/Build.cs`), bootstrapped by `build.ps1` / `build.sh`
(`build.cmd` forwards to either). Default target is `RunUnitTests`.
The orchestrator is [Fallout](https://fallout.build) (`build/Build.cs`), the maintained hard fork
of NUKE. `build.ps1` / `build.sh` (`build.cmd` forwards to either) provision the SDK, then
`dotnet tool restore` + `dotnet fallout`; the CLI itself is pinned in
`.config/dotnet-tools.json` and resolves `build/_build.csproj` by convention. Default target is
`RunUnitTests`.

```powershell
.\build.ps1 # restore, compile, run the full test suite
.\build.ps1 -Target Compile # other targets: Clean Restore Compile RunUnitTests
.\build.ps1 -Target Package # CreatePackage Package PrePublish Publish
```

For the normal edit/test loop use the SDK directly — much faster than the NUKE bootstrap:
For the normal edit/test loop use the SDK directly — much faster than the Fallout bootstrap:

```powershell
dotnet build src/AngleSharp.Js.sln
Expand Down
16 changes: 5 additions & 11 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
# CONFIGURATION
###########################################################################

$BuildProjectFile = "$PSScriptRoot\nuke\_build.csproj"
$TempDirectory = "$PSScriptRoot\\.nuke\temp"
$TempDirectory = "$PSScriptRoot\.fallout\temp"

$DotNetGlobalFile = "$PSScriptRoot\\global.json"
$DotNetGlobalFile = "$PSScriptRoot\global.json"
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
$DotNetChannel = "STS"

Expand All @@ -32,7 +31,7 @@ function ExecSafe([scriptblock] $cmd) {
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}

# If dotnet CLI is installed globally and it matches requested version, use for execution
# If dotnet CLI is installed globally, use it; otherwise provision a local copy under .fallout\temp.
if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
$(dotnet --version) -and $LASTEXITCODE -eq 0) {
$env:DOTNET_EXE = (Get-Command "dotnet").Path
Expand Down Expand Up @@ -65,10 +64,5 @@ else {

Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"

if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
}

ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
ExecSafe { & $env:DOTNET_EXE tool restore }
ExecSafe { & $env:DOTNET_EXE fallout $BuildArguments }
16 changes: 5 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
# CONFIGURATION
###########################################################################

BUILD_PROJECT_FILE="$SCRIPT_DIR/nuke/_build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
TEMP_DIRECTORY="$SCRIPT_DIR/.fallout/temp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
DOTNET_GLOBAL_FILE="$SCRIPT_DIR/global.json"
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
DOTNET_CHANNEL="STS"

Expand All @@ -27,7 +26,7 @@ function FirstJsonValue {
perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}"
}

# If dotnet CLI is installed globally and it matches requested version, use for execution
# If dotnet CLI is installed globally, use it; otherwise provision a local copy under .fallout/temp.
if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then
export DOTNET_EXE="$(command -v dotnet)"
else
Expand Down Expand Up @@ -58,10 +57,5 @@ fi

echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"

if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
"$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true
fi

"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
"$DOTNET_EXE" tool restore
exec "$DOTNET_EXE" fallout "$@"
File renamed without changes.
38 changes: 16 additions & 22 deletions nuke/Build.cs → build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
using Fallout.Common;
using Fallout.Common.CI.GitHubActions;
using Fallout.Common.IO;
using Fallout.Common.Tools.DotNet;
using Fallout.Common.Tools.GitHub;
using Fallout.Common.Utilities.Collections;
using Fallout.Solutions;
using Microsoft.Build.Exceptions;
using Nuke.Common;
using Nuke.Common.CI.GitHubActions;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.GitHub;
using Nuke.Common.Utilities.Collections;
using Octokit;
using Octokit.Internal;
using Serilog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using Project = Nuke.Common.ProjectModel.Project;
using static Fallout.Common.Tools.DotNet.DotNetTasks;
using Project = Fallout.Solutions.Project;

class Build : NukeBuild
class Build : FalloutBuild
{
/// Support plugins are available for:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode

public static int Main () => Execute<Build>(x => x.RunUnitTests);

[Nuke.Common.Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
[Fallout.Common.Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;

[Nuke.Common.Parameter("ReleaseNotesFilePath - To determine the SemanticVersion")]
[Fallout.Common.Parameter("ReleaseNotesFilePath - To determine the SemanticVersion")]
readonly AbsolutePath ReleaseNotesFilePath = RootDirectory / "CHANGELOG.md";

[Nuke.Common.Parameter("AngleSharp package version override (e.g. 1.0.0 for compatibility checks)")]
[Fallout.Common.Parameter("AngleSharp package version override (e.g. 1.0.0 for compatibility checks)")]
readonly string AngleSharpVersion;

[Solution]
Expand All @@ -52,7 +46,7 @@ class Build : NukeBuild

Project TargetProject { get; set; }

// Note: The ChangeLogTasks from Nuke itself look buggy. So using the Cake source code.
// Note: The built-in ChangeLogTasks (inherited from NUKE) look buggy. So using the Cake source code.
IReadOnlyList<ReleaseNotes> ChangeLog { get; set; }

ReleaseNotes LatestReleaseNotes { get; set; }
Expand Down Expand Up @@ -244,7 +238,7 @@ protected override void OnBuildInitialized()
var credentials = new Credentials(gitHubToken);

GitHubTasks.GitHubClient = new GitHubClient(
new ProductHeaderValue(nameof(NukeBuild)),
new ProductHeaderValue(nameof(FalloutBuild)),
new InMemoryCredentialStore(credentials));

GitHubTasks.GitHubClient.Repository.Release
Expand Down Expand Up @@ -280,7 +274,7 @@ protected override void OnBuildInitialized()
var credentials = new Credentials(gitHubToken);

GitHubTasks.GitHubClient = new GitHubClient(
new ProductHeaderValue(nameof(NukeBuild)),
new ProductHeaderValue(nameof(FalloutBuild)),
new InMemoryCredentialStore(credentials));

GitHubTasks.GitHubClient.Repository.Release
Expand Down
2 changes: 1 addition & 1 deletion nuke/Configuration.cs → build/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
using System.Linq;
using Nuke.Common.Tooling;
using Fallout.Common.Tooling;

[TypeConverter(typeof(TypeConverter<Configuration>))]
public class Configuration : Enumeration
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions build/_build.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<FalloutRootDirectory>..</FalloutRootDirectory>
<FalloutScriptDirectory>..</FalloutScriptDirectory>
<FalloutTelemetryVersion>1</FalloutTelemetryVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Fallout.Common" Version="11.0.18" />
<!-- Transitive pin: Fallout.Common 11.0.18 still resolves 10.0.6, which carries advisories. -->
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.10" PrivateAssets="All" />
</ItemGroup>

</Project>
20 changes: 0 additions & 20 deletions nuke/_build.csproj

This file was deleted.

2 changes: 1 addition & 1 deletion src/AngleSharp.Js.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AngleSharp.Js", "AngleSharp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AngleSharp.Js.Tests", "AngleSharp.Js.Tests\AngleSharp.Js.Tests.csproj", "{18B0B97B-8795-4DC2-A1E7-8070255BE718}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "..\nuke\_build.csproj", "{07DA52AA-8F6F-4F43-B09E-6AE899E95E43}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "..\build\_build.csproj", "{07DA52AA-8F6F-4F43-B09E-6AE899E95E43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<Copyright>Copyright 2017-2026, AngleSharp</Copyright>
</PropertyGroup>

<!-- Fallback for builds that bypass the NUKE script. A release takes its version from the top
entry of CHANGELOG.md, which nuke/Build.cs passes in as -p:Version, so this value only
<!-- Fallback for builds that bypass the Fallout script. A release takes its version from the top
entry of CHANGELOG.md, which build/Build.cs passes in as -p:Version, so this value only
affects a plain `dotnet build` and no longer needs bumping for a release. -->
<PropertyGroup Label="Versioning">
<Version>1.0.0</Version>
Expand Down