This commit is contained in:
James Newton-King
2017-02-06 12:12:40 +13:00
parent 60ac1ea3a4
commit 20f59f7d70
+28 -4
View File
@@ -136,7 +136,19 @@ task Package -depends Build {
Write-Host Write-Host
exec { & $nugetPath pack $nuspecPath -Symbols } exec { & $nugetPath pack $nuspecPath -Symbols }
exec { dotnet pack $workingSourceDir\Newtonsoft.Json\project.json -c Release }
try
{
Set-Location "$workingSourceDir\Newtonsoft.Json"
exec { dotnet --version | Out-Default }
exec { dotnet pack $workingSourceDir\Newtonsoft.Json\project.json -c Release | Out-Default }
}
finally
{
Set-Location $baseDir
}
move -Path .\*.nupkg -Destination $workingDir\NuGet move -Path .\*.nupkg -Destination $workingDir\NuGet
} }
@@ -220,6 +232,11 @@ function NetCliBuild($build)
$projectPath = "$workingSourceDir\Newtonsoft.Json\project.json" $projectPath = "$workingSourceDir\Newtonsoft.Json\project.json"
exec { .\Tools\Dotnet\dotnet-install.ps1 -Version $netCliVersion | Out-Default } exec { .\Tools\Dotnet\dotnet-install.ps1 -Version $netCliVersion | Out-Default }
try
{
Set-Location "$workingSourceDir\Newtonsoft.Json"
exec { dotnet --version | Out-Default } exec { dotnet --version | Out-Default }
Write-Host -ForegroundColor Green "Restoring packages for $name" Write-Host -ForegroundColor Green "Restoring packages for $name"
@@ -229,12 +246,22 @@ function NetCliBuild($build)
Write-Host -ForegroundColor Green "Building $projectPath $framework" Write-Host -ForegroundColor Green "Building $projectPath $framework"
exec { dotnet build $projectPath -f $framework -c Release -o bin\Release\$framework | Out-Default } exec { dotnet build $projectPath -f $framework -c Release -o bin\Release\$framework | Out-Default }
} }
finally
{
Set-Location $baseDir
}
}
function NetCliTests($build) function NetCliTests($build)
{ {
$name = $build.TestsName $name = $build.TestsName
exec { .\Tools\Dotnet\dotnet-install.ps1 -Version $netCliVersion | Out-Default } exec { .\Tools\Dotnet\dotnet-install.ps1 -Version $netCliVersion | Out-Default }
try
{
Set-Location "$workingSourceDir\Newtonsoft.Json.Tests"
exec { dotnet --version | Out-Default } exec { dotnet --version | Out-Default }
Write-Host -ForegroundColor Green "Restoring packages for $name" Write-Host -ForegroundColor Green "Restoring packages for $name"
@@ -244,9 +271,6 @@ function NetCliTests($build)
Write-Host -ForegroundColor Green "Ensuring test project builds for $name" Write-Host -ForegroundColor Green "Ensuring test project builds for $name"
Write-Host Write-Host
try
{
Set-Location "$workingSourceDir\Newtonsoft.Json.Tests"
exec { dotnet test "$workingSourceDir\Newtonsoft.Json.Tests\project.json" -f netcoreapp1.0 -c Release -parallel none | Out-Default } exec { dotnet test "$workingSourceDir\Newtonsoft.Json.Tests\project.json" -f netcoreapp1.0 -c Release -parallel none | Out-Default }
} }
finally finally