Skip to content

Commit

Permalink
-Build
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Mar 22, 2015
1 parent c38c87c commit c565d56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Build/Newtonsoft.Json.nuspec
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Newtonsoft.Json</id>
<version>7.0.1-beta1</version>
<version></version>
<title>Json.NET</title>
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
<authors>James Newton-King</authors>
Expand Down
14 changes: 13 additions & 1 deletion Build/build.ps1
Expand Up @@ -2,6 +2,7 @@
$zipFileName = "Json70r1.zip"
$majorVersion = "7.0"
$majorWithReleaseVersion = "7.0.1"
$nugetPrelease = "beta1"
$version = GetVersion $majorWithReleaseVersion
$packageId = "Newtonsoft.Json"
$signAssemblies = $false
Expand Down Expand Up @@ -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

Expand All @@ -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
}
Expand Down

0 comments on commit c565d56

Please sign in to comment.