-Build
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Newtonsoft.Json</id>
|
<id>Newtonsoft.Json</id>
|
||||||
<version>7.0.1-beta1</version>
|
<version></version>
|
||||||
<title>Json.NET</title>
|
<title>Json.NET</title>
|
||||||
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
|
<description>Json.NET is a popular high-performance JSON framework for .NET</description>
|
||||||
<authors>James Newton-King</authors>
|
<authors>James Newton-King</authors>
|
||||||
|
|||||||
+13
-1
@@ -2,6 +2,7 @@
|
|||||||
$zipFileName = "Json70r1.zip"
|
$zipFileName = "Json70r1.zip"
|
||||||
$majorVersion = "7.0"
|
$majorVersion = "7.0"
|
||||||
$majorWithReleaseVersion = "7.0.1"
|
$majorWithReleaseVersion = "7.0.1"
|
||||||
|
$nugetPrelease = "beta1"
|
||||||
$version = GetVersion $majorWithReleaseVersion
|
$version = GetVersion $majorWithReleaseVersion
|
||||||
$packageId = "Newtonsoft.Json"
|
$packageId = "Newtonsoft.Json"
|
||||||
$signAssemblies = $false
|
$signAssemblies = $false
|
||||||
@@ -90,15 +91,23 @@ task Package -depends Build {
|
|||||||
|
|
||||||
if ($buildNuGet)
|
if ($buildNuGet)
|
||||||
{
|
{
|
||||||
|
$nugetVersion = $majorWithReleaseVersion
|
||||||
|
if ($nugetPrelease -ne $null)
|
||||||
|
{
|
||||||
|
$nugetVersion = $nugetVersion + "-" + $nugetPrelease
|
||||||
|
}
|
||||||
|
|
||||||
New-Item -Path $workingDir\NuGet -ItemType Directory
|
New-Item -Path $workingDir\NuGet -ItemType Directory
|
||||||
|
|
||||||
$nuspecPath = "$workingDir\NuGet\Newtonsoft.Json.nuspec"
|
$nuspecPath = "$workingDir\NuGet\Newtonsoft.Json.nuspec"
|
||||||
Copy-Item -Path "$buildDir\Newtonsoft.Json.nuspec" -Destination $nuspecPath -recurse
|
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)
|
$xml = [xml](Get-Content $nuspecPath)
|
||||||
Edit-XmlNodes -doc $xml -xpath "//*[local-name() = 'id']" -value $packageId
|
Edit-XmlNodes -doc $xml -xpath "//*[local-name() = 'id']" -value $packageId
|
||||||
|
Edit-XmlNodes -doc $xml -xpath "//*[local-name() = 'version']" -value $nugetVersion
|
||||||
|
|
||||||
Write-Host $xml.OuterXml
|
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
|
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 }
|
exec { .\Tools\NuGet\NuGet.exe pack $nuspecPath -Symbols }
|
||||||
move -Path .\*.nupkg -Destination $workingDir\NuGet
|
move -Path .\*.nupkg -Destination $workingDir\NuGet
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user