Skip to content

Commit 6d35fe2

Browse files
authored
Merge pull request #96 from lahma/nuke-8
Upgrade to NUKE 8
2 parents 551f1d3 + 2c68f60 commit 6d35fe2

File tree

7 files changed

+31
-17
lines changed

7 files changed

+31
-17
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",
@@ -131,4 +131,4 @@
131131
}
132132
}
133133
}
134-
}
134+
}

build.cmd

100644100755
File mode changed.

build.ps1

+8-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ $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

23-
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
2423
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
25-
$env:DOTNET_MULTILEVEL_LOOKUP = 0
24+
$env:DOTNET_NOLOGO = 1
2625

2726
###########################################################################
2827
# EXECUTION
@@ -61,9 +60,15 @@ else {
6160
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
6261
}
6362
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
63+
$env:PATH = "$DotNetDirectory;$env:PATH"
6464
}
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

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ 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
20-
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
21-
export DOTNET_MULTILEVEL_LOOKUP=0
20+
export DOTNET_NOLOGO=1
2221

2322
###########################################################################
2423
# EXECUTION
@@ -54,9 +53,15 @@ else
5453
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
5554
fi
5655
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
56+
export PATH="$DOTNET_DIRECTORY:$PATH"
5757
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 -- "$@"

nuke/Build.cs

+9-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using System.Linq;
1717
using Nuke.Common.Tooling;
1818
using static Nuke.Common.IO.FileSystemTasks;
19-
using static Nuke.Common.IO.PathConstruction;
2019
using static Nuke.Common.Tools.DotNet.DotNetTasks;
2120
using static Nuke.Common.Tools.NuGet.NuGetTasks;
2221
using Project = Nuke.Common.ProjectModel.Project;
@@ -100,7 +99,7 @@ protected override void OnBuildInitialized()
10099

101100
Log.Information("Building version: {Version}", Version);
102101

103-
TargetProject = Solution.GetProject(SourceDirectory / TargetProjectName / $"{TargetLibName}.csproj" );
102+
TargetProject = Solution.GetProject(TargetLibName);
104103
TargetProject.NotNull("TargetProject could not be loaded!");
105104

106105
TargetFrameworks = TargetProject.GetTargetFrameworks();
@@ -113,7 +112,7 @@ protected override void OnBuildInitialized()
113112
.Before(Restore)
114113
.Executes(() =>
115114
{
116-
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
115+
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
117116
});
118117

119118
Target Restore => _ => _
@@ -130,6 +129,7 @@ protected override void OnBuildInitialized()
130129
DotNetBuild(s => s
131130
.SetProjectFile(Solution)
132131
.SetConfiguration(Configuration)
132+
.SetContinuousIntegrationBuild(IsServerBuild)
133133
.EnableNoRestore());
134134
});
135135

@@ -143,6 +143,7 @@ protected override void OnBuildInitialized()
143143
.EnableNoRestore()
144144
.EnableNoBuild()
145145
.SetProcessEnvironmentVariable("prefetched", "false")
146+
.When(GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions"))
146147
);
147148

148149
DotNetTest(s => s
@@ -151,6 +152,7 @@ protected override void OnBuildInitialized()
151152
.EnableNoRestore()
152153
.EnableNoBuild()
153154
.SetProcessEnvironmentVariable("prefetched", "true")
155+
.When(GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions"))
154156
);
155157
});
156158

@@ -183,9 +185,9 @@ protected override void OnBuildInitialized()
183185
.SetTargetPath(nuspec)
184186
.SetVersion(Version)
185187
.SetOutputDirectory(NugetDirectory)
186-
.SetSymbols(true)
187-
.SetSymbolPackageFormat("snupkg")
188-
.AddProperty("Configuration", Configuration)
188+
.EnableSymbols()
189+
.SetSymbolPackageFormat(NuGetSymbolPackageFormat.snupkg)
190+
.SetConfiguration(Configuration)
189191
);
190192
});
191193

@@ -202,7 +204,7 @@ protected override void OnBuildInitialized()
202204
throw new BuildAbortedException("Could not resolve the NuGet API key.");
203205
}
204206

205-
foreach (var nupkg in GlobFiles(NugetDirectory, "*.nupkg"))
207+
foreach (var nupkg in NugetDirectory.GlobFiles("*.nupkg"))
206208
{
207209
NuGetPush(s => s
208210
.SetTargetPath(nupkg)

nuke/_build.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace></RootNamespace>
77
<NoWarn>CS0649;CS0169</NoWarn>
88
<NukeRootDirectory>..</NukeRootDirectory>
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="6.2.1" />
14+
<PackageReference Include="Nuke.Common" Version="8.0.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/AngleSharp.Js.sln

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AngleSharp.Js", "AngleSharp
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AngleSharp.Js.Tests", "AngleSharp.Js.Tests\AngleSharp.Js.Tests.csproj", "{18B0B97B-8795-4DC2-A1E7-8070255BE718}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "..\nuke\_build.csproj", "{07DA52AA-8F6F-4F43-B09E-6AE899E95E43}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)