This commit is contained in:
James Newton-King
2017-09-09 22:26:22 +12:00
parent 42ccb6b1c0
commit a05864d40d
+4 -14
View File
@@ -8,7 +8,7 @@
$signAssemblies = $false $signAssemblies = $false
$signKeyPath = "C:\Development\Releases\newtonsoft.snk" $signKeyPath = "C:\Development\Releases\newtonsoft.snk"
$buildDocumentation = $false $buildDocumentation = $false
$buildNuGet = $false $buildNuGet = $true
$treatWarningsAsErrors = $false $treatWarningsAsErrors = $false
$workingName = if ($workingName) {$workingName} else {"Working"} $workingName = if ($workingName) {$workingName} else {"Working"}
$netCliChannel = "2.0" $netCliChannel = "2.0"
@@ -44,7 +44,7 @@
framework '4.6x86' framework '4.6x86'
task default -depends Test task default -depends Test,Package
# Ensure a clean working directory # Ensure a clean working directory
task Clean { task Clean {
@@ -151,13 +151,7 @@ task Package -depends Build {
Compress-Archive -Path $workingDir\Package\* -DestinationPath $workingDir\$zipFileName Compress-Archive -Path $workingDir\Package\* -DestinationPath $workingDir\$zipFileName
} }
# Unzip package to a location task Test -depends Build {
task Deploy -depends Package {
Expand-Archive -Path $workingDir\$zipFileName -DestinationPath "$workingDir\Deployed"
}
# Run tests on deployed files
task Test -depends Deploy {
foreach ($build in $script:enabledBuilds) foreach ($build in $script:enabledBuilds)
{ {
Write-Host "Calling $($build.TestsFunction)" Write-Host "Calling $($build.TestsFunction)"
@@ -243,11 +237,7 @@ function NUnitTests($build)
{ {
$testDir = if ($build.TestFramework -ne $null) { $build.TestFramework } else { $build.Framework } $testDir = if ($build.TestFramework -ne $null) { $build.TestFramework } else { $build.Framework }
$framework = $build.NUnitFramework $framework = $build.NUnitFramework
$testRunDir = "$workingDir\Deployed\Bin\$($build.Framework)" $testRunDir = "$workingSourceDir\Newtonsoft.Json.Tests\bin\Release\$testDir"
Write-Host -ForegroundColor Green "Copying test assembly $testDir to deployed directory"
Write-Host
robocopy "$workingSourceDir\Newtonsoft.Json.Tests\bin\Release\$testDir" $testRunDir /MIR /NFL /NDL /NJS /NC /NS /NP /XO | Out-Default
Write-Host -ForegroundColor Green "Running NUnit tests $testDir" Write-Host -ForegroundColor Green "Running NUnit tests $testDir"
Write-Host Write-Host