mirror of
https://github.com/nefarius/ViGEmBus.git
synced 2025-08-10 00:52:17 +00:00
53 lines
1.8 KiB
C#
53 lines
1.8 KiB
C#
using System;
|
|
using System.Linq;
|
|
using Nuke.Common;
|
|
using Nuke.Common.Git;
|
|
using Nuke.Common.Tools.GitVersion;
|
|
using Nuke.Common.Tools.MSBuild;
|
|
using Nuke.Core;
|
|
using static Nuke.Common.Tools.MSBuild.MSBuildTasks;
|
|
using static Nuke.Core.IO.FileSystemTasks;
|
|
using static Nuke.Core.IO.PathConstruction;
|
|
using static Nuke.Core.EnvironmentInfo;
|
|
|
|
class Build : NukeBuild
|
|
{
|
|
// Console application entry. Also defines the default target.
|
|
public static int Main () => Execute<Build>(x => x.Compile);
|
|
|
|
// Auto-injection fields:
|
|
|
|
// [GitVersion] readonly GitVersion GitVersion;
|
|
// Semantic versioning. Must have 'GitVersion.CommandLine' referenced.
|
|
|
|
// [GitRepository] readonly GitRepository GitRepository;
|
|
// Parses origin, branch name and head from git config.
|
|
|
|
// [Parameter] readonly string MyGetApiKey;
|
|
// Returns command-line arguments and environment variables.
|
|
|
|
Target Clean => _ => _
|
|
.OnlyWhen(() => false) // Disabled for safety.
|
|
.Executes(() =>
|
|
{
|
|
DeleteDirectories(GlobDirectories(SourceDirectory, "**/bin", "**/obj"));
|
|
EnsureCleanDirectory(OutputDirectory);
|
|
});
|
|
|
|
Target Restore => _ => _
|
|
.DependsOn(Clean)
|
|
.Executes(() =>
|
|
{
|
|
MSBuild(s => DefaultMSBuildRestore.SetTargetPlatform(MSBuildTargetPlatform.x64));
|
|
MSBuild(s => DefaultMSBuildRestore.SetTargetPlatform(MSBuildTargetPlatform.x86));
|
|
});
|
|
|
|
Target Compile => _ => _
|
|
.DependsOn(Restore)
|
|
.Executes(() =>
|
|
{
|
|
MSBuild(s => DefaultMSBuildCompile.SetTargetPlatform(MSBuildTargetPlatform.x64));
|
|
MSBuild(s => DefaultMSBuildCompile.SetTargetPlatform(MSBuildTargetPlatform.x86));
|
|
});
|
|
}
|