Created
November 30, 2017 23:38
-
-
Save johannesprinz/b99bcadd5ac8f638fdc50b1b696cb294 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Include ".\references.ps1" | |
properties { | |
$dir = @{ | |
msbuild = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"; | |
src = (Join-Path -Path $psake.build_script_dir -ChildPath '..' | Get-Item).FullName; | |
} | |
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] | |
$tool = @{ | |
msbuild = (Join-Path -Path 'C:\Program Files (x86)\MSBuild\14.0\Bin' -ChildPath 'MSBuild.exe' | Get-Item).FullName; | |
} | |
$file = @{ | |
solution = (Join-Path -Path $dir.src -ChildPath 'MySolution.sln' | Get-Item).FullName; | |
msBuildLog = Join-Path -Path $dir.src -ChildPath msbuild.log; | |
} | |
$configuration = "Debug" | |
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] | |
$msba = @( | |
"/p:configuration=$configuration", | |
"/p:VisualStudioVersion=14.0", | |
"/p:MSBuildFrameworkToolsPath=$($dir.msbuild)", | |
"/nologo", | |
"/v:q", | |
"/clp:Summary", | |
"/flp:Verbosity=diagnostic;Append;LogFile=$($file.msBuildLog)" | |
); | |
} | |
Task Default -Depends Build-PowerShell, Build-Solution | |
Task Clean { | |
exec { & "$($tool.msbuild)" "/t:clean" "$($file.solution)" $msba } | |
Remove-Item -Path $file.msBuildLog -Force -ErrorAction SilentlyContinue; | |
} | |
Task Build-PowerShell { | |
Get-ChildItem .\Modules -Recurse -Filter *.psm1 | ForEach-Object { Import-Module -Name $_.FullName -Force } | |
Invoke-ScriptAnalyzer -Path . -Recurse; | |
} | |
Task Build-Solution { | |
exec { & "$($tool.msbuild)" "$($file.solution)" $msba } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment