Nefarius.Peripherals.Serial.../build/Build.cs
Benjamin Höglinger-Stelzer c9a1de27ca Updated nuke
2019-12-27 19:54:38 +01:00

62 lines
2.0 KiB
C#

using System;
using System.Linq;
using Nuke.Common;
using Nuke.Common.CI.AppVeyor;
using Nuke.Common.Execution;
using Nuke.Common.Git;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Utilities.Collections;
using static Nuke.Common.EnvironmentInfo;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
[CheckBuildProjectConfigurations]
[UnsetVisualStudioEnvironmentVariables]
class Build : NukeBuild
{
/// Support plugins are available for:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode
public static int Main () => Execute<Build>(x => x.Compile);
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
[Solution] readonly Solution Solution;
[GitRepository] readonly GitRepository GitRepository;
Target Clean => _ => _
.Before(Restore)
.Executes(() =>
{
});
Target Restore => _ => _
.Executes(() =>
{
DotNetRestore(_ => _
.SetProjectFile(Solution));
});
Target Compile => _ => _
.DependsOn(Restore)
.Executes(() =>
{
DotNetBuild(_ => _
.SetProjectFile(Solution)
.SetConfiguration(Configuration)
.EnableNoRestore()
.SetAssemblyVersion(AppVeyor.Instance.BuildVersion)
.SetFileVersion(AppVeyor.Instance.BuildVersion)
.SetVersionSuffix(AppVeyor.Instance.BuildVersion)
.SetVersion(AppVeyor.Instance.BuildVersion));
});
}