update packages: json, webgrease

This commit is contained in:
Samuele E. Locatelli
2016-11-14 16:46:58 +01:00
parent 36672df7f6
commit 19422ddc64
25 changed files with 13 additions and 57459 deletions
Binary file not shown.
+6 -5
View File
@@ -25,7 +25,6 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<TargetFrameworkProfile />
<WebGreaseLibPath>..\packages\WebGrease.1.5.2\lib</WebGreaseLibPath>
<UseGlobalApplicationHostFile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -115,8 +114,9 @@
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.DynamicData" />
@@ -136,8 +136,9 @@
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WebGrease">
<HintPath>..\packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath>
<Reference Include="WebGrease, Version=1.6.5135.21930, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
+5 -1
View File
@@ -107,12 +107,16 @@
</dependentAssembly>-->
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.webServer>
+2 -2
View File
@@ -19,6 +19,6 @@
<package id="Microsoft.ScriptManager.MSAjax" version="1.0.1" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.8.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="WebGrease" version="1.6.0" targetFramework="net45" />
</packages>
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-93
View File
@@ -1,93 +0,0 @@
param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
{
# user is installing from VS NuGet console
# get reference to the window, the console host and the input history
# show webpage if "install-package newtonsoft.json" was last input
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
[System.Reflection.BindingFlags]::NonPublic)
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
if ($prop -eq $null) { return }
$hostInfo = $prop.GetValue($consoleWindow)
if ($hostInfo -eq $null) { return }
$history = $hostInfo.WpfConsole.InputHistory.History
$lastCommand = $history | select -last 1
if ($lastCommand)
{
$lastCommand = $lastCommand.Trim().ToLower()
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
{
$dte2.ItemOperations.Navigate($url) | Out-Null
}
}
}
else
{
# user is installing from VS NuGet dialog
# get reference to the window, then smart output console provider
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
[System.Reflection.BindingFlags]::NonPublic)
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
[System.Reflection.BindingFlags]::NonPublic)
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
$instance = $instanceField.GetValue($null)
if ($instance -eq $null) { return }
$consoleProvider = $consoleField.GetValue($instance)
if ($consoleProvider -eq $null) { return }
$console = $consoleProvider.CreateOutputConsole($false)
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
[System.Reflection.BindingFlags]::NonPublic)
if ($messagesField -eq $null) { return }
$messages = $messagesField.GetValue($console)
if ($messages -eq $null) { return }
$operations = $messages -split "=============================="
$lastOperation = $operations | select -last 1
if ($lastOperation)
{
$lastOperation = $lastOperation.ToLower()
$lines = $lastOperation -split "`r`n"
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
if ($installMatch)
{
$dte2.ItemOperations.Navigate($url) | Out-Null
}
}
}
}
catch
{
# stop potential errors from bubbling up
# worst case the splash page won't open
}
# yolo
Binary file not shown.
Binary file not shown.
Binary file not shown.
-90
View File
@@ -1,90 +0,0 @@
param($installPath, $toolsPath, $package, $project)
# Return a relative path with reference to root as Uri object
# $rootPath - root path
# $relativePath - relative path
# $appendToRelativePath - Optional parameter. If provided will be appended to relative Path using Path.Combine()
Function GetRelativeUri($rootPath, $relativePath, $appendToRelativePath)
{
if($rootPath -eq $null)
{
return $null
}
if($relativePath -eq $null)
{
return $null
}
$rootUri = new-object system.Uri($rootPath)
$targetPath = $relativePath
# If appendToRelativePath is provided then use it
if($appendToRelativePath -ne $null)
{
$targetPath = [io.path]::Combine($relativePath, $appendToRelativePath)
}
$targetUri = new-object system.Uri($targetPath)
$relativeUri = $rootUri.MakeRelativeUri($targetUri)
return $relativeUri
}
# Visual Studio execution done via NuGet Package Manager
Function VSExecution($installPath, $package, $project)
{
#$project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty)
# Get the msbuild version of the project and add the import
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1
# add a property for us to be able to reference the path where the package was installed
$relativePackageUri = GetRelativeUri $project.FullName $installPath"\lib"
$msbuild.Xml.AddProperty("WebGreaseLibPath", $relativePackageUri.ToString().Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar))
# save the project
$project.Save()
}
# Command line execution done by any external tool (For example, NuGetUpdater)
# $package - package id
# $project - parameter value is path to Project file in this case.
Function CommandLineExecution($installPath, $package, $project)
{
[Reflection.Assembly]::LoadWithPartialName("Microsoft.Build")
[Reflection.Assembly]::LoadWithPartialName("System.Xml")
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq")
# Get the msbuild version of the project and add the import
$projXDoc = [System.Xml.Linq.XDocument]::Load($project)
$defaultNameSpace = $projXDoc.Root.GetDefaultNamespace()
$propertyGroup = [System.Xml.Linq.XName]::Get("PropertyGroup", $defaultNameSpace.NamespaceName)
$webGreaseBuildLocation = [System.Xml.Linq.XName]::Get("WebGreaseLibPath", $defaultNameSpace.NamespaceName)
# add a property for us to be able to reference the path where the package was installed
$relativePackageUri = GetRelativeUri $project.FullName $installPath"\lib"
$propGroupElement = $projXDoc.Root.Elements($propertyGroup) | Select-Object -First 1
IF ($propGroupElement -ne $null)
{
$newElement = new-object System.Xml.Linq.XElement($webGreaseBuildLocation, $relativePackageUri.ToString().Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar))
$propGroupElement.Add($newElement)
}
# save the project
$projXDoc.Save($project)
}
IF ($project -is [system.string])
{
CommandLineExecution $installPath $package $project
}
ELSE
{
VSExecution $installPath $package $project
}
-63
View File
@@ -1,63 +0,0 @@
param($installPath, $toolsPath, $package, $project)
# Visual Studio execution done via NuGet Package Manager
Function VSExecution($toolsPath, $project)
{
$project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty)
# Get the msbuild version of the project and add the import
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1
# now remove our property that points to this package path, "WebGreaseLibPath"
foreach ($property in $msbuild.Properties)
{
if ($property.Name -eq "WebGreaseLibPath")
{
$propertyToRemove = $property
}
}
if ($propertyToRemove -ne $null)
{
$propertyToRemove.Project.RemoveProperty($propertyToRemove)
$project.Save()
}
$project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty)
}
# Command line execution done by any external tool (For example, NuGetUpdater)
# $project - parameter value is path to Project file in this case.
Function CommandLineExecution($toolsPath, $project)
{
[Reflection.Assembly]::LoadWithPartialName("System.Xml")
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq")
$projXDoc = [System.Xml.Linq.XDocument]::Load($project)
$defaultNameSpace = $projXDoc.Root.GetDefaultNamespace()
$xmlReader = $projXDoc.CreateReader()
$namespaceManager = new-object System.Xml.XmlNamespaceManager($xmlReader.NameTable)
$namespaceManager.AddNamespace("my", $defaultNameSpace.NamespaceName)
$msnRfPackageElement = [System.Xml.XPath.Extensions]::XPathSelectElement($projXDoc.Root, "//my:WebGreaseLibPath", $namespaceManager)
if($msnRfPackageElement -ne $null)
{
$msnRfPackageElement.Remove()
}
# save the project
$projXDoc.Save($project)
}
IF ($project -is [system.string])
{
CommandLineExecution $toolsPath $project
}
ELSE
{
VSExecution $toolsPath $project
}