-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use .NET 8 SDK #68
Merged
Merged
Use .NET 8 SDK #68
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
using System; | ||
using System.Linq; | ||
using Nuke.Common; | ||
using Nuke.Common.CI; | ||
using Nuke.Common.Execution; | ||
using Nuke.Common.IO; | ||
using Nuke.Common.ProjectModel; | ||
|
@@ -10,38 +8,39 @@ | |
using static Nuke.Common.IO.FileSystemTasks; | ||
using static Nuke.Common.Tools.DotNet.DotNetTasks; | ||
using Nuke.Common.Tools.OctoVersion; | ||
using Serilog; | ||
|
||
[CheckBuildProjectConfigurations] | ||
[UnsetVisualStudioEnvironmentVariables] | ||
class Build : NukeBuild | ||
{ | ||
const string CiBranchNameEnvVariable = "OCTOVERSION_CurrentBranch"; | ||
|
||
readonly Configuration Configuration = Configuration.Release; | ||
|
||
[Solution] readonly Solution Solution; | ||
[Solution] readonly Solution Solution = null!; // assigned by Nuke via reflection | ||
|
||
[Parameter] readonly bool? OctoVersionAutoDetectBranch = NukeBuild.IsLocalBuild; | ||
|
||
#pragma warning disable CS0414 // Field assigned but never used | ||
[Parameter("Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable " + CiBranchNameEnvVariable + ".", Name = CiBranchNameEnvVariable)] | ||
readonly string OctoVersionBranch; | ||
readonly string OctoVersionBranch = null!; // assigned by Nuke via reflection | ||
YuKitsune marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#pragma warning restore CS0414 | ||
|
||
[Parameter] readonly int? OctoVersionFullSemVer; | ||
[Parameter] readonly string? OctoVersionFullSemVer; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one caught me by surprise. After upgrading, Nuke started to complain about this. Weird that it wasn't doing it before. |
||
[Parameter] readonly int? OctoVersionMajor; | ||
[Parameter] readonly int? OctoVersionMinor; | ||
[Parameter] readonly int? OctoVersionPatch; | ||
|
||
[Required] | ||
[OctoVersion( | ||
AutoDetectBranchParameter = nameof(OctoVersionAutoDetectBranch), | ||
BranchParameter = nameof(OctoVersionBranch), | ||
FullSemVerParameter = nameof(OctoVersionFullSemVer), | ||
MajorParameter = nameof(OctoVersionMajor), | ||
MinorParameter = nameof(OctoVersionMinor), | ||
PatchParameter = nameof(OctoVersionPatch), | ||
Framework = "net6.0")] | ||
|
||
readonly OctoVersionInfo OctoVersionInfo; | ||
AutoDetectBranchMember = nameof(OctoVersionAutoDetectBranch), | ||
BranchMember = nameof(OctoVersionBranch), | ||
FullSemVerMember = nameof(OctoVersionFullSemVer), | ||
MajorMember = nameof(OctoVersionMajor), | ||
MinorMember = nameof(OctoVersionMinor), | ||
PatchMember = nameof(OctoVersionPatch), | ||
Framework = "net8.0")] | ||
readonly OctoVersionInfo OctoVersionInfo = null!; // assigned by Nuke via reflection | ||
|
||
static AbsolutePath SourceDirectory => RootDirectory / "source"; | ||
static AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts"; | ||
|
@@ -52,9 +51,9 @@ class Build : NukeBuild | |
.Before(Restore) | ||
.Executes(() => | ||
{ | ||
SourceDirectory.GlobDirectories("**/bin", "**/obj", "**/TestResults").ForEach(DeleteDirectory); | ||
EnsureCleanDirectory(ArtifactsDirectory); | ||
EnsureCleanDirectory(PublishDirectory); | ||
SourceDirectory.GlobDirectories("**/bin", "**/obj", "**/TestResults").ForEach(x => x.DeleteDirectory()); | ||
ArtifactsDirectory.CreateOrCleanDirectory(); | ||
PublishDirectory.CreateOrCleanDirectory(); | ||
}); | ||
|
||
Target Restore => _ => _ | ||
|
@@ -70,7 +69,7 @@ class Build : NukeBuild | |
.DependsOn(Restore) | ||
.Executes(() => | ||
{ | ||
Logger.Info("Building Octopus Versioning v{0}", OctoVersionInfo.FullSemVer); | ||
Log.Information("Building Octopus Versioning v{0}", OctoVersionInfo.FullSemVer); | ||
|
||
DotNetBuild(_ => _ | ||
.SetProjectFile(Solution) | ||
|
@@ -96,7 +95,7 @@ class Build : NukeBuild | |
.Produces(ArtifactsDirectory / "*.nupkg") | ||
.Executes(() => | ||
{ | ||
Logger.Info("Packing Octopus Versioning v{0}", OctoVersionInfo.FullSemVer); | ||
Log.Information("Packing Octopus Versioning v{0}", OctoVersionInfo.FullSemVer); | ||
|
||
// This is done to pass the data to github actions | ||
Console.Out.WriteLine($"::set-output name=semver::{OctoVersionInfo.FullSemVer}"); | ||
|
@@ -118,7 +117,7 @@ class Build : NukeBuild | |
.TriggeredBy(Pack) | ||
.Executes(() => | ||
{ | ||
EnsureExistingDirectory(LocalPackagesDir); | ||
LocalPackagesDir.CreateDirectory(); | ||
ArtifactsDirectory.GlobFiles("*.nupkg") | ||
.ForEach(package => | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
source/Octopus.Versioning.Tests/Octopus.Versioning.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has since been integrated into the
SolutionAttribute
.https://github.com/nuke-build/nuke/blob/4a24cd4e78d43b59deb8aa2033c696c8ceb51dd6/source/Nuke.Common/Execution/CheckBuildProjectConfigurationsAttribute.cs#L18-L21