Skip to content

Commit

Permalink
Merge pull request #135 from OctopusDeploy/dylan/net8
Browse files Browse the repository at this point in the history
Update to .NET 8
  • Loading branch information
dylanlerch authored Sep 24, 2024
2 parents 2e94969 + aa47faf commit bef3497
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 78 deletions.
143 changes: 72 additions & 71 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,72 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build",
"properties": {
"AutoDetectBranch": {
"type": "boolean",
"description": "Whether to auto-detect the branch name - this is okay for a local build, but should not be used under CI"
},
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"OCTOVERSION_CurrentBranch": {
"type": "string",
"description": "Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable OCTOVERSION_CurrentBranch"
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
}
},
"definitions": {
"build": {
"type": "object",
"Host": {
"type": "string",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"ExecutableTarget": {
"type": "string",
"enum": [
"CalculateVersion",
"Clean",
"Compile",
"CopyToLocalPackages",
"Pack",
"Restore",
"Test"
]
},
"Verbosity": {
"type": "string",
"description": "",
"enum": [
"Verbose",
"Normal",
"Minimal",
"Quiet"
]
},
"NukeBuild": {
"properties": {
"AutoDetectBranch": {
"type": "boolean",
"description": "Whether to auto-detect the branch name - this is okay for a local build, but should not be used under CI"
},
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
Expand All @@ -27,34 +76,13 @@
"description": "Shows the help text for this build assembly"
},
"Host": {
"type": "string",
"description": "Host for execution. Default is 'automatic'",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
"$ref": "#/definitions/Host"
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"OCTOVERSION_CurrentBranch": {
"type": "string",
"description": "Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable OCTOVERSION_CurrentBranch"
},
"Partition": {
"type": "string",
"description": "Partition to use on CI"
Expand All @@ -78,49 +106,22 @@
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
"CalculateVersion",
"Clean",
"Compile",
"CopyToLocalPackages",
"Pack",
"Restore",
"Test"
]
"$ref": "#/definitions/ExecutableTarget"
}
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"CalculateVersion",
"Clean",
"Compile",
"CopyToLocalPackages",
"Pack",
"Restore",
"Test"
]
"$ref": "#/definitions/ExecutableTarget"
}
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
"$ref": "#/definitions/Verbosity"
}
}
}
}
}
},
"$ref": "#/definitions/NukeBuild"
}
4 changes: 2 additions & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class Build : NukeBuild
[Parameter("Whether to auto-detect the branch name - this is okay for a local build, but should not be used under CI.")]
readonly bool AutoDetectBranch = IsLocalBuild;

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

AbsolutePath SourceDirectory => RootDirectory / "source";
Expand Down
6 changes: 3 additions & 3 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.1.2" />
<PackageDownload Include="OctoVersion.Tool" Version="[0.3.49]" />
<PackageReference Include="Nuke.Common" Version="8.1.0" />
<PackageReference Include="Octopus.OctoVersion.Tool" Version="0.3.403" ExcludeAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
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.301",
"version": "8.0.401",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion source/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Tests</AssemblyName>
<RootNamespace>Tests</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down

0 comments on commit bef3497

Please sign in to comment.