Skip to content

Commit

Permalink
refactor: reorder Build properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Flash0ver committed Nov 27, 2023
1 parent aadc371 commit 6e39841
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/build/FlashOWare.Tool.Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,23 @@ class Build : NukeBuild
{
public static int Main() => Execute<Build>(x => x.Compile);

[GitRepository] readonly GitRepository GitRepository;

[Solution] readonly Solution Solution;

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

[GitRepository] readonly GitRepository GitRepository;
[Parameter] readonly string VersionPrefix;
[Parameter] readonly string VersionSuffix;

[Parameter] readonly string NuGetSource;

[Parameter][Secret] readonly string NuGetApiKey;

AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
AbsolutePath TestResultsDirectory => ArtifactsDirectory / "test-results";
AbsolutePath PackageDirectory => ArtifactsDirectory / "package";

Target Clean => _ => _
.Before(Restore)
Expand All @@ -52,15 +65,6 @@ class Build : NukeBuild
ArtifactsDirectory.DeleteDirectory();
});

[Solution] readonly Solution Solution;

[Parameter] readonly string VersionPrefix;
[Parameter] readonly string VersionSuffix;

[Parameter] readonly string NuGetSource;

[Parameter][Secret] readonly string NuGetApiKey;

Target Restore => _ => _
.Executes(() =>
{
Expand All @@ -78,10 +82,6 @@ class Build : NukeBuild
.SetNoRestore(FinishedTargets.Contains(Restore)));
});

AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
AbsolutePath TestResultsDirectory => ArtifactsDirectory / "test-results";
AbsolutePath PackageDirectory => ArtifactsDirectory / "package";

Target Test => _ => _
.DependsOn(Compile)
.Executes(() =>
Expand Down

0 comments on commit 6e39841

Please sign in to comment.