Skip to content

Commit dc58113

Browse files
authored
Upgrade to NUKE 7.0.2 (#238)
1 parent 5654b5f commit dc58113

File tree

6 files changed

+29
-19
lines changed

6 files changed

+29
-19
lines changed

.nuke/build.schema.json

+2-2
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",
@@ -153,4 +153,4 @@
153153
}
154154
}
155155
}
156-
}
156+
}

build-support/nuke-build/Build.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ partial class Build : NukeBuild
3737
readonly bool BuildEms = false;
3838

3939
[Parameter("Version")]
40-
readonly string ProjectVersion = "3.0.1";
40+
readonly string ProjectVersion = "3.0.2";
4141

4242
[Solution] readonly Solution Solution;
4343
[GitRepository] readonly GitRepository GitRepository;
@@ -80,10 +80,10 @@ protected override void OnBuildInitialized()
8080
.Before(Restore)
8181
.Executes(() =>
8282
{
83-
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
84-
TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
85-
EnsureCleanDirectory(ArtifactsDirectory);
86-
EnsureCleanDirectory(BuildDirectory);
83+
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
84+
TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
85+
ArtifactsDirectory.CreateOrCleanDirectory();
86+
BuildDirectory.CreateOrCleanDirectory();
8787
});
8888

8989
Target Restore => _ => _
@@ -178,7 +178,7 @@ protected override void OnBuildInitialized()
178178
.Executes(() =>
179179
{
180180
var binDirectory = RootDirectory / "bin";
181-
EnsureCleanDirectory(binDirectory);
181+
binDirectory.CreateOrCleanDirectory();
182182

183183
var moduleNames = new[]
184184
{
@@ -219,7 +219,7 @@ protected override void OnBuildInitialized()
219219

220220
IEnumerable<Project> GetActiveProjects()
221221
{
222-
var packTargets = Solution.GetProjects("*")
222+
var packTargets = Solution.AllProjects
223223
.Where(x => x.Name != "Spring.Messaging.Ems" || BuildEms)
224224
.Where(x => !x.Name.Contains("_build"));
225225
return packTargets;

build-support/nuke-build/_build.csproj

+1-1
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
</ItemGroup>
1616

1717
</Project>

build.cmd

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:; set -eo pipefail
2-
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
3-
:; ${SCRIPT_DIR}/build.sh "$@"
4-
:; exit $?
5-
6-
@ECHO OFF
7-
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
1+
:; set -eo pipefail
2+
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
3+
:; ${SCRIPT_DIR}/build.sh "$@"
4+
:; exit $?
5+
6+
@ECHO OFF
7+
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*

build.ps1

+6-1
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
@@ -65,5 +65,10 @@ else {
6565

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

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+
}
72+
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.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ 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
@@ -58,5 +58,10 @@ fi
5858

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

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
65+
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)