Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/Newtonsoft.Json.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorJamesNK <james@newtonking.com>2011-04-22 07:11:42 +0400
committerJamesNK <james@newtonking.com>2011-04-22 07:11:42 +0400
commit21a2a7e4f793e395987d60b3ae0296de885c5774 (patch)
treeeaa4a7a7fcb584b4ee4e22dc20a309b5476898f7 /Build
parent2c190ec438187affa34b161bfecf65bcf626cacb (diff)
-Demo
-Changed build script to support NuGet profiles
Diffstat (limited to 'Build')
-rw-r--r--Build/build.ps136
1 files changed, 20 insertions, 16 deletions
diff --git a/Build/build.ps1 b/Build/build.ps1
index e95a9b2..b94aae8 100644
--- a/Build/build.ps1
+++ b/Build/build.ps1
@@ -1,10 +1,10 @@
properties {
$zipFileName = "Json40r2.zip"
- $majorVersion = "4.2"
+ $majorVersion = "4.0.2"
$version = GetVersion $majorVersion
$signAssemblies = $false
$signKeyPath = "D:\Development\Releases\newtonsoft.snk"
- $buildDocumentation = $false
+ $buildDocumentation = $true
$buildNuGet = $true
$baseDir = resolve-path ..
@@ -15,10 +15,10 @@
$releaseDir = "$baseDir\Release"
$workingDir = "$baseDir\Working"
$builds = @(
- @{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net"; NuGetDir = "net40-client"; Framework="net-4.0"},
+ @{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net"; NuGetDir = "net40-client,net40-full"; Framework="net-4.0"},
@{Name = "Newtonsoft.Json.WindowsPhone"; TestsName = $null; Constants="SILVERLIGHT;WINDOWS_PHONE"; FinalDir="WindowsPhone"; NuGetDir = "sl3-wp"; Framework="net-4.0"},
@{Name = "Newtonsoft.Json.Silverlight"; TestsName = "Newtonsoft.Json.Tests.Silverlight"; Constants="SILVERLIGHT"; FinalDir="Silverlight"; NuGetDir = "sl4"; Framework="net-4.0"},
- @{Name = "Newtonsoft.Json.Net35"; TestsName = "Newtonsoft.Json.Tests.Net35"; Constants="NET35"; FinalDir="Net35"; NuGetDir = "net35-client"; Framework="net-2.0"},
+ @{Name = "Newtonsoft.Json.Net35"; TestsName = "Newtonsoft.Json.Tests.Net35"; Constants="NET35"; FinalDir="Net35"; NuGetDir = "net35-client,net35-full"; Framework="net-2.0"},
@{Name = "Newtonsoft.Json.Net20"; TestsName = "Newtonsoft.Json.Tests.Net20"; Constants="NET20"; FinalDir="Net20"; NuGetDir = "net20"; Framework="net-2.0"}
)
}
@@ -45,7 +45,7 @@ task Clean {
task Build -depends Clean {
Write-Host -ForegroundColor Green "Updating assembly version"
Write-Host
- Update-AssemblyInfoFiles $sourceDir ($majorVersion + '.0.0') $version
+ Update-AssemblyInfoFiles $sourceDir ($majorVersion + '.0') $version
foreach ($build in $builds)
{
@@ -80,14 +80,6 @@ task Package -depends Merge {
Copy-Item -Path "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" -Destination $workingDir\Package\Bin\$finalDir -recurse
}
- if ($buildDocumentation)
- {
- # Sandcastle has issues when compiling with .NET 4 MSBuild - http://shfb.codeplex.com/Thread/View.aspx?ThreadId=50652
- exec { .$env:windir\Microsoft.NET\Framework\v3.5\MSBuild.exe "/t:Clean;Rebuild" /p:Configuration=Release "/p:DocumentationSourcePath=$workingDir\Package\Bin\Net" $docDir\doc.shfbproj } "Error building documentation. Check that you have Sandcastle, Sandcastle Help File Builder and HTML Help Workshop installed."
-
- move -Path $workingDir\Documentation\Documentation.chm -Destination $workingDir\Package\Documentation.chm
- move -Path $workingDir\Documentation\LastBuild.log -Destination $workingDir\Documentation.log
- }
if ($buildNuGet)
{
New-Item -Path $workingDir\NuGet -ItemType Directory
@@ -97,15 +89,27 @@ task Package -depends Merge {
{
$name = $build.TestsName
$finalDir = $build.FinalDir
- $frameworkDir = $build.NuGetDir
+ $frameworkDirs = $build.NuGetDir.Split(",")
- Copy-Item -Path "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" -Destination $workingDir\NuGet\lib\$frameworkDir -recurse
+ foreach ($frameworkDir in $frameworkDirs)
+ {
+ Copy-Item -Path "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" -Destination $workingDir\NuGet\lib\$frameworkDir -recurse
+ }
}
exec { .\Tools\NuGet\NuGet.exe pack $workingDir\NuGet\Newtonsoft.Json.nuspec }
move -Path .\*.nupkg -Destination $workingDir\NuGet
}
+ if ($buildDocumentation)
+ {
+ # Sandcastle has issues when compiling with .NET 4 MSBuild - http://shfb.codeplex.com/Thread/View.aspx?ThreadId=50652
+ exec { .$env:windir\Microsoft.NET\Framework\v3.5\MSBuild.exe "/t:Clean;Rebuild" /p:Configuration=Release "/p:DocumentationSourcePath=$workingDir\Package\Bin\Net" $docDir\doc.shfbproj } "Error building documentation. Check that you have Sandcastle, Sandcastle Help File Builder and HTML Help Workshop installed."
+
+ move -Path $workingDir\Documentation\Documentation.chm -Destination $workingDir\Package\Documentation.chm
+ move -Path $workingDir\Documentation\LastBuild.log -Destination $workingDir\Documentation.log
+ }
+
Copy-Item -Path $docDir\readme.txt -Destination $workingDir\Package\
Copy-Item -Path $docDir\versions.txt -Destination $workingDir\Package\Bin\
@@ -188,7 +192,7 @@ function GetVersion($majorVersion)
$minute = $now.Minute
$revision = "{0:00}{1:00}" -f $hour, $minute
- return $majorVersion + "." + $minor + "." + $revision
+ return $majorVersion + "." + $minor
}
function Update-AssemblyInfoFiles ([string] $sourceDir, [string] $assemblyVersionNumber, [string] $fileVersionNumber)