-Build
-Documentation
This commit is contained in:
+39
-3
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -29,8 +29,8 @@
|
||||
<Topic id="ConvertingJSONandXML" visible="True" title="Converting between JSON and XML" />
|
||||
<Topic id="JsonNetVsDotNetSerializers" visible="True" title="Json.NET vs .NET Serializers" />
|
||||
<Topic id="JsonNetVsWindowsDataJson" visible="True" title="Json.NET vs Windows.Data.Json" />
|
||||
<Topic id="Samples" visible="True" isExpanded="true" isSelected="true" title="Samples">
|
||||
<Topic id="d6e185d5-c992-44fc-8d8f-d9acc2bbec2f" visible="True" noFile="true" title="Serializing JSON">
|
||||
<Topic id="Samples" visible="True" isExpanded="true" title="Samples">
|
||||
<Topic id="d6e185d5-c992-44fc-8d8f-d9acc2bbec2f" visible="True" noFile="true" isExpanded="true" title="Serializing JSON">
|
||||
<Topic id="SerializeObject" visible="True" title="Serialize an Object" />
|
||||
<Topic id="SerializeCollection" visible="True" title="Serialize a Collection" />
|
||||
<Topic id="SerializeDictionary" visible="True" title="Serialize a Dictionary" />
|
||||
@@ -53,7 +53,7 @@
|
||||
<Topic id="DefaultValueHandlingIgnore" visible="True" title="DefaultValueHandling setting" />
|
||||
<Topic id="DeserializeMissingMemberHandling" visible="True" title="MissingMemberHandling setting" />
|
||||
<Topic id="NullValueHandlingIgnore" visible="True" title="NullValueHandling setting" />
|
||||
<Topic id="ReferenceLoopHandlingIgnore" visible="True" title="RefereneLoopHandling setting" />
|
||||
<Topic id="ReferenceLoopHandlingIgnore" visible="True" isSelected="true" title="ReferenceLoopHandling setting" />
|
||||
<Topic id="PreserveReferencesHandlingObject" visible="True" title="PreserveReferencesHandling setting" />
|
||||
<Topic id="SerializeDateFormatHandling" visible="True" title="DateFormatHandling setting" />
|
||||
<Topic id="SerializeDateTimeZoneHandling" visible="True" title="DateTimeZoneHandling setting" />
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 22 KiB |
@@ -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")]
|
||||
|
||||
@@ -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")]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user