From c565d56fdfe0394ba053181f7f9ed03c2ed83428 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sun, 22 Mar 2015 20:43:39 +1300 Subject: [PATCH] -Build --- Build/Newtonsoft.Json.nuspec | 2 +- Build/build.ps1 | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Build/Newtonsoft.Json.nuspec b/Build/Newtonsoft.Json.nuspec index bcf3cfa6..2ccddd08 100644 --- a/Build/Newtonsoft.Json.nuspec +++ b/Build/Newtonsoft.Json.nuspec @@ -2,7 +2,7 @@ Newtonsoft.Json - 7.0.1-beta1 + Json.NET Json.NET is a popular high-performance JSON framework for .NET James Newton-King diff --git a/Build/build.ps1 b/Build/build.ps1 index 2eab8508..393e0acc 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -2,6 +2,7 @@ $zipFileName = "Json70r1.zip" $majorVersion = "7.0" $majorWithReleaseVersion = "7.0.1" + $nugetPrelease = "beta1" $version = GetVersion $majorWithReleaseVersion $packageId = "Newtonsoft.Json" $signAssemblies = $false @@ -90,15 +91,23 @@ task Package -depends Build { if ($buildNuGet) { + $nugetVersion = $majorWithReleaseVersion + if ($nugetPrelease -ne $null) + { + $nugetVersion = $nugetVersion + "-" + $nugetPrelease + } + New-Item -Path $workingDir\NuGet -ItemType Directory $nuspecPath = "$workingDir\NuGet\Newtonsoft.Json.nuspec" Copy-Item -Path "$buildDir\Newtonsoft.Json.nuspec" -Destination $nuspecPath -recurse - Write-Host "Building NuGet package from $nuspecPath" + Write-Host "Updating nuspec file at $nuspecPath" -ForegroundColor Green + Write-Host $xml = [xml](Get-Content $nuspecPath) Edit-XmlNodes -doc $xml -xpath "//*[local-name() = 'id']" -value $packageId + Edit-XmlNodes -doc $xml -xpath "//*[local-name() = 'version']" -value $nugetVersion Write-Host $xml.OuterXml @@ -124,6 +133,9 @@ task Package -depends Build { robocopy $sourceDir $workingDir\NuGet\src *.cs /S /NFL /NDL /NJS /NC /NS /NP /XD Newtonsoft.Json.Tests Newtonsoft.Json.TestConsole obj | Out-Default + Write-Host "Building NuGet package with ID $packageId and version $nugetVersion" -ForegroundColor Green + Write-Host + exec { .\Tools\NuGet\NuGet.exe pack $nuspecPath -Symbols } move -Path .\*.nupkg -Destination $workingDir\NuGet }