diff --git a/appveyor.yml b/appveyor.yml index 12e59a9..6d55a1d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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: diff --git a/build/Build.cs b/build/Build.cs index 9b8509f..2929489 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -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