Skip to content

Commit

Permalink
Run ReSharper code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Octobob committed May 21, 2023
1 parent 83bda77 commit 0cc5910
Show file tree
Hide file tree
Showing 29 changed files with 3,208 additions and 3,227 deletions.
24 changes: 17 additions & 7 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,24 @@
[ShutdownDotNetAfterServerBuild]
class Build : NukeBuild
{
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
public Configuration Configuration => IsLocalBuild ? Configuration.Debug : Configuration.Release;
[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;

[Parameter("Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable OCTOVERSION_CurrentBranch.", Name = "OCTOVERSION_CurrentBranch")]
[Parameter(
"Branch name for OctoVersion to use to calculate the version number. Can be set via the environment variable OCTOVERSION_CurrentBranch.",
Name = "OCTOVERSION_CurrentBranch")]
readonly string BranchName;
[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, BranchParameter = nameof(BranchName),
AutoDetectBranchParameter = nameof(AutoDetectBranch), Framework = "net6.0")]
readonly OctoVersionInfo OctoVersionInfo;

[Solution] readonly Solution Solution;

[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
public Configuration Configuration => IsLocalBuild ? Configuration.Debug : Configuration.Release;

AbsolutePath SourceDirectory => RootDirectory / "source";
AbsolutePath TestsDirectory => RootDirectory / "tests";
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
Expand All @@ -48,13 +54,15 @@ class Build : NukeBuild
EnsureCleanDirectory(ArtifactsDirectory);
EnsureCleanDirectory(PublishDirectory);
});

Target Restore => _ => _
.DependsOn(Clean)
.Executes(() =>
{
DotNetRestore(s => s
.SetProjectFile(Solution));
});

Target Compile => _ => _
.DependsOn(Restore)
.Executes(() =>
Expand All @@ -65,6 +73,7 @@ class Build : NukeBuild
.SetVersion(OctoVersionInfo.FullSemVer)
.EnableNoRestore());
});

Target Test => _ => _
.DependsOn(Compile)
.Executes(() =>
Expand Down Expand Up @@ -93,7 +102,8 @@ class Build : NukeBuild
.AddProperty("Version", OctoVersionInfo.FullSemVer)
);
TeamCity.Instance?.PublishArtifacts(ArtifactsDirectory / $"Octopus.CoreParsers.Hcl.{OctoVersionInfo.FullSemVer}.nupkg");
TeamCity.Instance?.PublishArtifacts(ArtifactsDirectory /
$"Octopus.CoreParsers.Hcl.{OctoVersionInfo.FullSemVer}.nupkg");
});

Target CopyToLocalPackages => _ => _
Expand Down

0 comments on commit 0cc5910

Please sign in to comment.