From 432a6e89452bd7ed16c794f3bb3e9d07ef083b3d Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sun, 1 Feb 2015 03:24:00 +1300 Subject: [PATCH] -Build -Documentation --- Build/build.ps1 | 42 ++++++++++++++++-- Doc/doc.content | 6 +-- Doc/icons/favicon.ico | Bin 1150 -> 22382 bytes .../Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index 30b42ad0..2e9861ee 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -3,6 +3,7 @@ $majorVersion = "7.0" $majorWithReleaseVersion = "7.0.1" $version = GetVersion $majorWithReleaseVersion + $packageId = "Newtonsoft.Json" $signAssemblies = $false $signKeyPath = "C:\Development\Releases\newtonsoft.snk" $buildDocumentation = $false @@ -87,8 +88,19 @@ task Package -depends Build { if ($buildNuGet) { - New-Item -Path $workingDir\NuGet -ItemType Directory - Copy-Item -Path "$buildDir\Newtonsoft.Json.nuspec" -Destination $workingDir\NuGet\Newtonsoft.Json.nuspec -recurse + 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" + + $xml = [xml](Get-Content $nuspecPath) + Edit-XmlNodes -doc $xml -xpath "//*[local-name() = 'id']" -value $packageId + + Write-Host $xml.OuterXml + + $xml.save($nuspecPath) New-Item -Path $workingDir\NuGet\tools -ItemType Directory Copy-Item -Path "$buildDir\install.ps1" -Destination $workingDir\NuGet\tools\install.ps1 -recurse @@ -110,7 +122,7 @@ task Package -depends Build { robocopy $sourceDir $workingDir\NuGet\src *.cs /S /NP /XD Newtonsoft.Json.Tests Newtonsoft.Json.TestConsole obj | Out-Default - exec { .\Tools\NuGet\NuGet.exe pack $workingDir\NuGet\Newtonsoft.Json.nuspec -Symbols } + exec { .\Tools\NuGet\NuGet.exe pack $nuspecPath -Symbols } move -Path .\*.nupkg -Destination $workingDir\NuGet } @@ -262,4 +274,28 @@ function Update-AssemblyInfoFiles ([string] $sourceDir, [string] $assemblyVersio % {$_ -replace $fileVersionPattern, $fileVersion } } | Set-Content $filename } +} + +function Edit-XmlNodes { + param ( + [xml] $doc, + [string] $xpath = $(throw "xpath is a required parameter"), + [string] $value = $(throw "value is a required parameter") + ) + + $nodes = $doc.SelectNodes($xpath) + $count = $nodes.Count + + Write-Host "Found $count nodes with path '$xpath'" + + foreach ($node in $nodes) { + if ($node -ne $null) { + if ($node.NodeType -eq "Element") { + $node.InnerXml = $value + } + else { + $node.Value = $value + } + } + } } \ No newline at end of file diff --git a/Doc/doc.content b/Doc/doc.content index 79923451..2740af2f 100644 --- a/Doc/doc.content +++ b/Doc/doc.content @@ -29,8 +29,8 @@ - - + + @@ -53,7 +53,7 @@ - + diff --git a/Doc/icons/favicon.ico b/Doc/icons/favicon.ico index 92b0eb6eeb5221cc0a9dba58388183f79b218a2a..466716cf3cf6eb912d16090bcaa66a4f52f87689 100644 GIT binary patch literal 22382 zcmd^{cZeKi7{U!hvnVm78(&2HZ)Y}?=;PrBR4l@Cv=#FMP(e}JPq_uoCLlEH-HJw zhM^)h2LV6CcgS-CCeo2x&Iy-_xLBJ20 zWUKr?O0id+HD7gF1mba{8vM?@>2V*7T?-e_!zUsj*Z*dee_PVbfa7b7&|i@zt`4J zYNIy`{1NKQhiq>N`^%DS;$!IU3zmj9Q67?i#C6m9=&lP+0$Rsb0M+KNvTsaz81%2f zC~YJ38B^*t#$(O)x{MhE{)XU6;DMEu{mcNWLqPkdJSOt$26uz6!08}$Ip+~C?t^$& z0lUs`(mx=sS5%)^+V9%&qxQXwZ(UT}$S*ODNQtjJR)dQGYeq2>zI(tb5b;iu+DA+( zCIh46$ATL1mD5=T#@Du*#M>U5S73bm7;eY3+od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Chwx2d3!8oX%xi?{LpUKRdJ z;`*)Vliy@e@3yckEoXe{8#~(0z?VjH2Y?blg9v9S|!&g=OmeU{~uo`IruxM znLMk-BG(DvC5N2jHPH4m&Gt?III!Bm*V(pRtJ~ze9=ORN?|2Q=e+N7P^qe|re$v?d zR&!2@PyTbjFBy0wadR1aG%0>NjKO^hSW<8eUT+7kX*s~X2b4fj&n7=fi``D+@Sg;V zct-tWJMpZQ3pF?dJPTa5Z5JK>Qr&qI{C5S{1HFgi!ZTH;^VqM+81A~SG6=2&uYo^7 zD%YfWYrJ)S3x2&|PjD)@3_JkzJXhzIBS7cF`u}xQqsRE~e>BYx8+@QZ(^yw1&2Z2d zGyS3L3ngDK(8L!DLOB@9{y>&OgShm<@kmDVO=X--GO#a)ax|2D0U;P43FMc)7f4TE zOJKaz$MPdFe)&>DC`quSK1>2hqMrINs>ngUnxLs)pLS&G3uP}~QqZK&EokcElMBJb z*A;?kIFglsW-yffVIVRZk)ldf3Z;i6vtWj#LaKy>*k6(mWl3CDY9Gl`*!My?VlEAq djU1pKY5FNouhzNq%X|NLR zFO2hc_buz;M+{+Z=H|`Yc{{roks13n8e-1{*_aiX7m=o!r7RQj=0pq|%?0!C_86QU z>dp3wy3V4vqPwJ%nCrE4c;5Hi+d8+CtzoglJ1tw^^;Q+!od0yXqaW{YIxYuE2V&%a zK^wGEBe}@k?Y6Y4Dt$Ou|Ju)bBL@sMKk*+=+Bz<*FEvN4)DH|bIUg~NeAGLyGt7bU zq&4*acV}Jhs;vPi|=Z4&Od&f7xy8n7`hZjdW%^KwLe_&ew2{M_YSpWb4 diff --git a/Src/Newtonsoft.Json.TestConsole/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.TestConsole/Properties/AssemblyInfo.cs index 2dc82677..b798f917 100644 --- a/Src/Newtonsoft.Json.TestConsole/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.TestConsole/Properties/AssemblyInfo.cs @@ -57,4 +57,4 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("7.0.0.0")] -[assembly: AssemblyFileVersion("7.0.1.18126")] +[assembly: AssemblyFileVersion("7.0.1.18131")] diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs index e6537f83..4ac7f2eb 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -76,4 +76,4 @@ using System.Security; // by using the '*' as shown below: [assembly: AssemblyVersion("7.0.0.0")] -[assembly: AssemblyFileVersion("7.0.1.18126")] +[assembly: AssemblyFileVersion("7.0.1.18131")] diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index 8f1f6726..094c5d45 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -92,5 +92,5 @@ using System.Security; // by using the '*' as shown below: [assembly: AssemblyVersion("7.0.0.0")] -[assembly: AssemblyFileVersion("7.0.1.18126")] +[assembly: AssemblyFileVersion("7.0.1.18131")] [assembly: CLSCompliant(true)]