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

55 lines
1.7 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;
2018-11-24 19:12:59 +01:00
using Nuke.Common.Git;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Tools.MSBuild;
using static Nuke.Common.EnvironmentInfo;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.MSBuild.MSBuildTasks;
class Build : NukeBuild
{
public static int Main () => Execute<Build>(x => x.Compile);
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly string Configuration = IsLocalBuild ? "Debug" : "Release";
[Solution("PInvokeSerialPort.sln")] readonly Solution Solution;
[GitRepository] readonly GitRepository GitRepository;
[GitVersion] readonly GitVersion GitVersion;
Target Clean => _ => _
.Executes(() =>
{
});
Target Restore => _ => _
.DependsOn(Clean)
.Executes(() =>
{
MSBuild(s => s
.SetTargetPath(Solution)
.SetTargets("Restore"));
});
Target Compile => _ => _
.DependsOn(Restore)
.Executes(() =>
{
MSBuild(s => s
.SetTargetPath(Solution)
.SetTargets("Rebuild")
.SetConfiguration(Configuration)
2019-12-27 19:48:55 +01:00
.SetAssemblyVersion(AppVeyor.Instance.BuildVersion)
.SetFileVersion(AppVeyor.Instance.BuildVersion)
.SetInformationalVersion(AppVeyor.Instance.BuildVersion)
2018-11-24 19:12:59 +01:00
.SetMaxCpuCount(Environment.ProcessorCount)
.SetNodeReuse(IsLocalBuild));
});
}