Skip to content

Commit

Permalink
Merge pull request #277 from OctopusDeploy/eoin/pet/net8
Browse files Browse the repository at this point in the history
Use .NET 8 SDK
  • Loading branch information
YuKitsune authored Dec 12, 2023
2 parents d5347de + 20cc3a3 commit 5ad5451
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 19 deletions.
7 changes: 6 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"

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

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
Expand Down Expand Up @@ -65,5 +65,10 @@ 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 }
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"

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

export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Expand Down Expand Up @@ -58,5 +58,10 @@ 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 -- "$@"
14 changes: 7 additions & 7 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BuildNevermore : NukeBuild

AbsolutePath LocalPackagesDir => RootDirectory / ".." / "LocalPackages";

[OctoVersion(BranchParameter = nameof(BranchName), AutoDetectBranchParameter = nameof(AutoDetectBranch), Framework = "net6.0")]
[OctoVersion(BranchMember = nameof(BranchName), AutoDetectBranchMember = nameof(AutoDetectBranch))]
public OctoVersionInfo OctoVersionInfo;

[Solution(GenerateProjects = true)] public Solution Solution;
Expand All @@ -34,10 +34,10 @@ class BuildNevermore : NukeBuild
Target Clean => _ => _
.Executes(() =>
{
EnsureCleanDirectory(ArtifactsDirectory);
SourceDirectory.GlobDirectories("**/bin").ForEach(EnsureCleanDirectory);
SourceDirectory.GlobDirectories("**/obj").ForEach(EnsureCleanDirectory);
SourceDirectory.GlobDirectories("**/TestResults").ForEach(EnsureCleanDirectory);
ArtifactsDirectory.CreateOrCleanDirectory();
SourceDirectory.GlobDirectories("**/bin").ForEach(x => x.CreateOrCleanDirectory());
SourceDirectory.GlobDirectories("**/obj").ForEach(x => x.CreateOrCleanDirectory());
SourceDirectory.GlobDirectories("**/TestResults").ForEach(x => x.CreateOrCleanDirectory());
});

Target Restore => _ => _
Expand Down Expand Up @@ -81,7 +81,7 @@ class BuildNevermore : NukeBuild
.DependsOn(Pack)
.Executes(() =>
{
EnsureExistingDirectory(ArtifactsDirectory);
ArtifactsDirectory.CreateDirectory();
SourceDirectory.GlobFiles("**/Nevermore*.nupkg")
.ForEach(f => CopyFileToDirectory(f, ArtifactsDirectory, FileExistsPolicy.Overwrite));
SourceDirectory.GlobFiles("**/Nevermore*.snupkg")
Expand All @@ -94,7 +94,7 @@ class BuildNevermore : NukeBuild
.OnlyWhenStatic(() => IsLocalBuild)
.Executes(() =>
{
EnsureExistingDirectory(LocalPackagesDir);
LocalPackagesDir.CreateOrCleanDirectory();
ArtifactsDirectory.GlobFiles("*.nupkg")
.ForEach(f => CopyFileToDirectory(f, LocalPackagesDir, FileExistsPolicy.Overwrite));
ArtifactsDirectory.GlobFiles("*.snupkg")
Expand Down
12 changes: 7 additions & 5 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<!-- NET8: Remove this when Nuke releases a new version which sets it for us -->
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.1.2" />
<PackageReference Include="Nuke.Common" Version="7.0.6" />
</ItemGroup>

<ItemGroup>
<PackageDownload Include="OctoVersion.Tool" Version="[0.3.49]" />
</ItemGroup>
<ItemGroup>
<PackageDownload Include="Octopus.OctoVersion.Tool" Version="[0.3.295]" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"version": "8.0.100",
"rollForward": "latestMajor",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion source/Nevermore.Benchmarks/Nevermore.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PackageId>Octopus.Nevermore.Benchmarks</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<IsPackable>false</IsPackable>
<WarningsAsErrors />
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Nevermore\Nevermore.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion source/Nevermore.Tests/Nevermore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<IsPackable>false</IsPackable>
<WarningsAsErrors />
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Nevermore\Nevermore.csproj" />
Expand Down

0 comments on commit 5ad5451

Please sign in to comment.