Updated build procedure to build DMF dependency via nuke

This commit is contained in:
Benjamin Höglinger-Stelzer
2020-12-04 11:22:08 +01:00
parent 2eb8a2e349
commit 92e6937633
2 changed files with 22 additions and 9 deletions

View File

@@ -6,13 +6,13 @@ platform:
configuration:
- Release
install:
- cmd: git submodule -q update --init
- cmd: git clone -q https://github.com/microsoft/DMF.git C:\projects\DMF
before_build:
- ps: Invoke-WebRequest "https://github.com/nefarius/vpatch/releases/latest/download/vpatch.exe" -OutFile vpatch.exe
- cmd: vpatch.exe --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file ".\sys\ViGEmBus.vcxproj" --vcxproj.inf-time-stamp
- cmd: vpatch.exe --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file ".\sys\ViGEmBus.rc" --resource.file-version --resource.product-version
build:
project: $(APPVEYOR_BUILD_FOLDER)\$(APPVEYOR_PROJECT_NAME).sln
build_script:
- ps: .\build.ps1
after_build:
- cmd: makecab.exe /f ViGEmBus_%PLATFORM%.ddf
artifacts:

View File

@@ -2,6 +2,7 @@ using System;
using System.Linq;
using Nuke.Common;
using Nuke.Common.CI;
using Nuke.Common.CI.AppVeyor;
using Nuke.Common.Execution;
using Nuke.Common.Git;
using Nuke.Common.IO;
@@ -31,11 +32,7 @@ class Build : NukeBuild
[Solution] readonly Solution Solution;
[GitRepository] readonly GitRepository GitRepository;
Target Clean => _ => _
.Before(Restore)
.Executes(() =>
{
});
AbsolutePath DmfSolution => RootDirectory / "../DMF/Dmf.sln";
Target Restore => _ => _
.Executes(() =>
@@ -45,8 +42,24 @@ class Build : NukeBuild
.SetTargets("Restore"));
});
Target BuildDmf => _ => _
.Executes(() =>
{
if(IsLocalBuild)
return;
Console.WriteLine($"DMF solution path: {DmfSolution}");
MSBuild(s => s
.SetTargetPath(DmfSolution)
.SetTargets("Rebuild")
.SetConfiguration(Configuration)
.SetMaxCpuCount(Environment.ProcessorCount)
.SetNodeReuse(IsLocalBuild));
});
Target Compile => _ => _
.DependsOn(Restore)
.DependsOn(BuildDmf)
.Executes(() =>
{
MSBuild(s => s