Skip to content

Commit 10d353e

Browse files
committed
Updating Nuke
1 parent 30dc1b3 commit 10d353e

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

.build/.build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="6.3.0" />
14+
<PackageReference Include="Nuke.Common" Version="7.0.2" />
1515
<PackageDownload Include="GitVersion.Tool" Version="[5.6.3]" />
1616
</ItemGroup>
1717

.build/Build.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected override void OnBuildInitialized()
6969
Target CleanOutput => _ => _
7070
.Executes(() =>
7171
{
72-
EnsureCleanDirectory(ArtifactsDirectory);
72+
ArtifactsDirectory.CreateOrCleanDirectory();
7373
});
7474

7575
Target Restore => _ => _
@@ -121,15 +121,15 @@ protected override void OnBuildInitialized()
121121
.SetFileVersion(AssemblySemFileVer)
122122
.SetInformationalVersion(InformationalVersion));
123123

124-
Compress(BuildBinDirectory / "Fluent.Ribbon" / Configuration, ArtifactsDirectory / $"Fluent.Ribbon-v{NuGetVersion}.zip");
125-
Compress(BuildBinDirectory / "Fluent.Ribbon.Showcase" / Configuration, ArtifactsDirectory / $"Fluent.Ribbon.Showcase-v{NuGetVersion}.zip");
124+
(BuildBinDirectory / "Fluent.Ribbon" / Configuration).CompressTo(ArtifactsDirectory / $"Fluent.Ribbon-v{NuGetVersion}.zip");
125+
(BuildBinDirectory / "Fluent.Ribbon.Showcase" / Configuration).CompressTo(ArtifactsDirectory / $"Fluent.Ribbon.Showcase-v{NuGetVersion}.zip");
126126
});
127127

128128
Target Test => _ => _
129129
.After(Compile)
130130
.Executes(() =>
131131
{
132-
EnsureCleanDirectory(TestResultsDir);
132+
TestResultsDir.CreateOrCleanDirectory();
133133

134134
DotNetTest(_ => _
135135
.SetConfiguration(Configuration)

.nuke/build.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"title": "Build Schema",
43
"$ref": "#/definitions/build",
4+
"title": "Build Schema",
55
"definitions": {
66
"build": {
77
"type": "object",
@@ -122,4 +122,4 @@
122122
}
123123
}
124124
}
125-
}
125+
}

Build.ps1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"
1818

1919
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
2020
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
21-
$DotNetChannel = "Current"
21+
$DotNetChannel = "STS"
2222

2323
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
2424
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
@@ -56,14 +56,19 @@ else {
5656
# Install by channel or version
5757
$DotNetDirectory = "$TempDirectory\dotnet-win"
5858
if (!(Test-Path variable:DotNetVersion)) {
59-
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
59+
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
6060
} else {
61-
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
61+
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
6262
}
6363
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
6464
}
6565

66-
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
66+
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
67+
68+
if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
69+
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
70+
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
71+
}
6772

6873
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
6974
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
:; exit $?
55

66
@ECHO OFF
7-
powershell -ExecutionPolicy ByPass -NoProfile "%~dp0build.ps1" %*
7+
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*

build.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
99
# CONFIGURATION
1010
###########################################################################
1111

12-
BUILD_PROJECT_FILE="$SCRIPT_DIR/build/.build.csproj"
12+
BUILD_PROJECT_FILE="$SCRIPT_DIR/.build/.build.csproj"
1313
TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
1414

1515
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
1616
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
17-
DOTNET_CHANNEL="Current"
17+
DOTNET_CHANNEL="STS"
1818

1919
export DOTNET_CLI_TELEMETRY_OPTOUT=1
2020
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
@@ -56,7 +56,12 @@ else
5656
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
5757
fi
5858

59-
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
59+
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
60+
61+
if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "NUKE_ENTERPRISE_TOKEN" != "" ]]; then
62+
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
63+
"$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
64+
fi
6065

6166
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
6267
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"

0 commit comments

Comments
 (0)