Skip to content
Open
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.globaltool": {
"version": "10.4.0",
"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 @@ -111,11 +118,11 @@
"properties": {
"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 @@ -128,7 +135,7 @@
}
},
{
"$ref": "#/definitions/NukeBuild"
"$ref": "#/definitions/FalloutBuild"
}
]
}
File renamed without changes.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ healthchecksdb

*.ncrunchsolution

# Nuke build artifacts
.nuke/temp/
# Fallout build artifacts
.fallout/temp/
bin/
nuke/bin/
nuke/obj/
build/bin/
build/obj/
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.
40 changes: 17 additions & 23 deletions nuke/Build.cs → build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
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.Tools.NuGet;
using Nuke.Common.Utilities.Collections;
using Fallout.Common;
using Fallout.Common.CI.GitHubActions;
using Fallout.Common.IO;
using Fallout.Solutions;
using Fallout.Common.Tools.DotNet;
using Fallout.Common.Tools.GitHub;
using Fallout.Common.Tools.NuGet;
using Fallout.Common.Utilities.Collections;
using Octokit;
using Octokit.Internal;
using Serilog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Nuke.Common.Tooling;
using Fallout.Common.Tooling;

using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.NuGet.NuGetTasks;
using static Fallout.Common.Tools.DotNet.DotNetTasks;
using static Fallout.Common.Tools.NuGet.NuGetTasks;

using Project = Nuke.Common.ProjectModel.Project;
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";

[Solution]
Expand Down Expand Up @@ -206,7 +200,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 @@ -242,7 +236,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.
9 changes: 4 additions & 5 deletions nuke/_build.csproj → build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<FalloutRootDirectory>..</FalloutRootDirectory>
<FalloutScriptDirectory>..</FalloutScriptDirectory>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="9.0.4" />
<PackageReference Include="Fallout.Common" Version="10.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down