diff --git a/build/Build.cs b/build/Build.cs index d17dcd6..ab5141c 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -15,7 +15,7 @@ [ShutdownDotNetAfterServerBuild] partial class Build : NukeBuild, IPublish { - public static int Main() => Execute(x => ((ICompile) x).Compile); + public static int Main() => Execute(x => ((ICompile)x).Compile); [GitRepository] readonly GitRepository GitRepository; @@ -33,10 +33,10 @@ partial class Build : NukeBuild, IPublish string PublicNuGetSource => "https://api.nuget.org/v3/index.json"; string FeedzNuGetSource => "https://f.feedz.io/acornima/acornima/nuget/index.json"; - [Parameter] [Secret] readonly string PublicNuGetApiKey; - [Parameter] [Secret] readonly string FeedzNuGetApiKey; + [Parameter][Secret] readonly string PublicNuGetApiKey; + [Parameter][Secret] readonly string FeedzNuGetApiKey; - bool IsPublicRelease => GitRepository.IsOnMainOrMasterBranch() && IsTaggedBuild; + bool IsPublicRelease => IsTaggedBuild; string IPublish.NuGetSource => IsPublicRelease ? PublicNuGetSource : FeedzNuGetSource; string IPublish.NuGetApiKey => IsPublicRelease ? PublicNuGetApiKey : FeedzNuGetApiKey; @@ -59,23 +59,22 @@ protected override void OnBuildInitialized() } Log.Information("BUILD SETUP"); - Log.Information("Configuration:\t{Configuration}", ((IHazConfiguration) this).Configuration); + Log.Information("Configuration:\t{Configuration}", ((IHazConfiguration)this).Configuration); Log.Information("Version suffix:\t{VersionSuffix}", VersionSuffix); Log.Information("Version:\t\t{Version}", Version); Log.Information("Tagged build:\t{IsTaggedBuild}", IsTaggedBuild); } - Target Clean => _ => _ + public Target Clean => _ => _ .Before(x => x.Restore) .Executes(() => { SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory()); TestDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory()); - ((IHazArtifacts) this).ArtifactsDirectory.CreateOrCleanDirectory(); + ((IHazArtifacts)this).ArtifactsDirectory.CreateOrCleanDirectory(); }); - public IEnumerable TestProjects => ((IHazSolution) this).Solution.AllProjects.Where(x => x.Name.Contains("Tests")); - + public IEnumerable TestProjects => ((IHazSolution)this).Solution.AllProjects.Where(x => x.Name.Contains("Tests")); public Configure CompileSettings => _ => _ .SetVersion(Version)