From 2b8847b96a4f325971cb457524634c5c107c2aeb Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Fri, 16 Feb 2024 19:08:13 +0200 Subject: [PATCH] Upgrade to NUKE 8 --- build.ps1 | 4 ++-- build.sh | 6 +++--- build/Build.cs | 8 ++------ build/_build.csproj | 4 ++-- solution/NPOI.Core.Test.sln | 2 -- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/build.ps1 b/build.ps1 index c0c0e6123..4634dc03e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -20,9 +20,8 @@ $DotNetGlobalFile = "$PSScriptRoot\\global.json" $DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" $DotNetChannel = "STS" -$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 -$env:DOTNET_MULTILEVEL_LOOKUP = 0 +$env:DOTNET_NOLOGO = 1 ########################################################################### # EXECUTION @@ -61,6 +60,7 @@ else { ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } } $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" } Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" diff --git a/build.sh b/build.sh index d4a7e51ec..fdff0c623 100755 --- a/build.sh +++ b/build.sh @@ -17,8 +17,7 @@ DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" DOTNET_CHANNEL="STS" export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -export DOTNET_MULTILEVEL_LOOKUP=0 +export DOTNET_NOLOGO=1 ########################################################################### # EXECUTION @@ -54,11 +53,12 @@ else "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path fi export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" + export PATH="$DOTNET_DIRECTORY:$PATH" fi echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" -if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "NUKE_ENTERPRISE_TOKEN" != "" ]]; then +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 diff --git a/build/Build.cs b/build/Build.cs index f10232190..e6f4fbc1d 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -28,8 +28,6 @@ partial class Build : NukeBuild [Solution] Solution Solution; [GitRepository] readonly GitRepository GitRepository; - static AbsolutePath SourceDirectory => RootDirectory / "src"; - static AbsolutePath ArtifactsDirectory => RootDirectory / "publish"; string TagVersion => GitRepository.Tags.SingleOrDefault(x => x.StartsWith("v"))?[1..]; @@ -45,8 +43,6 @@ partial class Build : NukeBuild string VersionSuffix; - static bool IsRunningOnWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - [Secret] [Parameter("GitHub API token")] readonly string GitHubToken; @@ -101,11 +97,11 @@ static void DeleteCompilationArtifacts() .Executes(() => { DotNetBuild(_ =>_ - .EnableNoRestore() + .SetNoRestore(SucceededTargets.Contains(Restore)) .SetConfiguration(Configuration) .SetDeterministic(IsServerBuild) .SetContinuousIntegrationBuild(IsServerBuild) - .SetVerbosity(DotNetVerbosity.Minimal) + .SetVerbosity(DotNetVerbosity.minimal) // obsolete missing XML documentation comment, XML comment on not valid language element, XML comment has badly formed XML, no matching tag in XML comment // need to use escaped separator in order for this to work .AddProperty("NoWarn", string.Join("%3B", new [] { 169, 612, 618, 1591, 1587, 1570, 1572, 1573, 1574 })) diff --git a/build/_build.csproj b/build/_build.csproj index 104cf021f..91a5396c8 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 CS0649;CS0169 .. @@ -11,7 +11,7 @@ - + diff --git a/solution/NPOI.Core.Test.sln b/solution/NPOI.Core.Test.sln index 9328d5a3b..188036c0a 100644 --- a/solution/NPOI.Core.Test.sln +++ b/solution/NPOI.Core.Test.sln @@ -63,9 +63,7 @@ Global {DA2CA3BD-1CAC-470C-9FA2-611A5768A76A}.Release|Any CPU.ActiveCfg = Release|Any CPU {DA2CA3BD-1CAC-470C-9FA2-611A5768A76A}.Release|Any CPU.Build.0 = Release|Any CPU {94B18BCF-84E8-401F-BAAB-0496AA136628}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94B18BCF-84E8-401F-BAAB-0496AA136628}.Debug|Any CPU.Build.0 = Debug|Any CPU {94B18BCF-84E8-401F-BAAB-0496AA136628}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94B18BCF-84E8-401F-BAAB-0496AA136628}.Release|Any CPU.Build.0 = Release|Any CPU {3DA1149D-46F8-4181-9976-E002BF2BFB76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3DA1149D-46F8-4181-9976-E002BF2BFB76}.Debug|Any CPU.Build.0 = Debug|Any CPU {3DA1149D-46F8-4181-9976-E002BF2BFB76}.Release|Any CPU.ActiveCfg = Release|Any CPU