-Build
This commit is contained in:
+3
-2
@@ -35,16 +35,17 @@ task default -depends Test
|
|||||||
|
|
||||||
# Ensure a clean working directory
|
# Ensure a clean working directory
|
||||||
task Clean {
|
task Clean {
|
||||||
|
Write-Host "Setting location to $baseDir"
|
||||||
Set-Location $baseDir
|
Set-Location $baseDir
|
||||||
|
|
||||||
if (Test-Path -path $workingDir)
|
if (Test-Path -path $workingDir)
|
||||||
{
|
{
|
||||||
Write-Output "Deleting existing working directory $workingDir"
|
Write-Host "Deleting existing working directory $workingDir"
|
||||||
|
|
||||||
del $workingDir -Recurse -Force
|
del $workingDir -Recurse -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "Creating working directory $workingDir"
|
Write-Host "Creating working directory $workingDir"
|
||||||
New-Item -Path $workingDir -ItemType Directory
|
New-Item -Path $workingDir -ItemType Directory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-4
@@ -2,17 +2,23 @@
|
|||||||
|
|
||||||
$path = Split-Path -Path $MyInvocation.MyCommand.Path
|
$path = Split-Path -Path $MyInvocation.MyCommand.Path
|
||||||
|
|
||||||
|
write-host "Importing psake"
|
||||||
Import-Module ($path + '\..\Tools\PSake\psake.psm1')
|
Import-Module ($path + '\..\Tools\PSake\psake.psm1')
|
||||||
|
|
||||||
Try
|
Try
|
||||||
{
|
{
|
||||||
|
write-host "Starting build.ps1"
|
||||||
Invoke-psake ($path + '\build.ps1') Test -framework 3.5
|
Invoke-psake ($path + '\build.ps1') Test -framework 3.5
|
||||||
|
|
||||||
if ($error -ne '')
|
if ($psake.build_success -eq $false)
|
||||||
{
|
{
|
||||||
$exitCode = $error.Count
|
write-host "build.ps1 failed" -fore RED
|
||||||
write-host "build.ps1 exit code: $exitCode" -fore RED
|
exit 1
|
||||||
exit $exitCode
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
write-host "build.ps1 succeeded" -fore GREEN
|
||||||
|
exit 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Finally
|
Finally
|
||||||
|
|||||||
Reference in New Issue
Block a user