Nefarius.Peripherals.Serial.../build/Build.cs

62 lines
2.0 KiB
C#
Raw Normal View History

2018-11-24 19:12:59 +01:00
using System;
using System.Linq;
using Nuke.Common;
2019-12-27 19:48:55 +01:00
using Nuke.Common.CI.AppVeyor;
2019-12-27 19:54:38 +01:00
using Nuke.Common.Execution;
2018-11-24 19:12:59 +01:00
using Nuke.Common.Git;
using Nuke.Common.ProjectModel;
2019-12-27 19:54:38 +01:00
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Utilities.Collections;
2018-11-24 19:12:59 +01:00
using static Nuke.Common.EnvironmentInfo;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
2019-12-27 19:54:38 +01:00
using static Nuke.Common.Tools.DotNet.DotNetTasks;
2018-11-24 19:12:59 +01:00
2019-12-27 19:54:38 +01:00
[CheckBuildProjectConfigurations]
[UnsetVisualStudioEnvironmentVariables]
2018-11-24 19:12:59 +01:00
class Build : NukeBuild
{
2019-12-27 19:54:38 +01:00
/// 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
2018-11-24 19:12:59 +01:00
public static int Main () => Execute<Build>(x => x.Compile);
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
2019-12-27 19:54:38 +01:00
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
2018-11-24 19:12:59 +01:00
2019-12-27 19:54:38 +01:00
[Solution] readonly Solution Solution;
2018-11-24 19:12:59 +01:00
[GitRepository] readonly GitRepository GitRepository;
Target Clean => _ => _
2019-12-27 19:54:38 +01:00
.Before(Restore)
2018-11-24 19:12:59 +01:00
.Executes(() =>
{
});
Target Restore => _ => _
.Executes(() =>
{
2019-12-27 19:54:38 +01:00
DotNetRestore(_ => _
.SetProjectFile(Solution));
2018-11-24 19:12:59 +01:00
});
Target Compile => _ => _
.DependsOn(Restore)
.Executes(() =>
{
2019-12-27 19:54:38 +01:00
DotNetBuild(_ => _
.SetProjectFile(Solution)
2018-11-24 19:12:59 +01:00
.SetConfiguration(Configuration)
2019-12-27 19:54:38 +01:00
.EnableNoRestore()
2019-12-27 19:48:55 +01:00
.SetAssemblyVersion(AppVeyor.Instance.BuildVersion)
.SetFileVersion(AppVeyor.Instance.BuildVersion)
2019-12-27 19:54:38 +01:00
.SetVersionSuffix(AppVeyor.Instance.BuildVersion)
.SetVersion(AppVeyor.Instance.BuildVersion));
2018-11-24 19:12:59 +01:00
});
2019-12-27 19:54:38 +01:00
2018-11-24 19:12:59 +01:00
}