From 419db0e832bd8e7f9ded0b28ebe7ae1620bf55d4 Mon Sep 17 00:00:00 2001 From: Mike Richmond Date: Fri, 29 Jul 2016 14:01:08 -0700 Subject: [PATCH] Removing dependency on JSON .Net for FullClr --- build.psm1 | 3 +- .../engine/hostifaces/LocalPipeline.cs | 59 +++++++++---------- src/System.Management.Automation/project.json | 3 - .../nativemsh/pwrshcommon/CMakeLists.txt | 2 - 4 files changed, 31 insertions(+), 36 deletions(-) diff --git a/build.psm1 b/build.psm1 index 89db96c773..dd850d1c8c 100644 --- a/build.psm1 +++ b/build.psm1 @@ -267,11 +267,12 @@ function Start-PSBuild { Push-Location "$PSScriptRoot\src\powershell-native" # Compile native resources + $currentLocation = Get-Location @("nativemsh/pwrshplugin") | % { $nativeResourcesFolder = $_ Get-ChildItem $nativeResourcesFolder -Filter "*.mc" | % { $command = @" -cmd.exe /C cd /d "(Get-Location)" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch" "&" mc.exe -o -d -c -U $($_.FullName) -h "$nativeResourcesFolder" -r "$nativeResourcesFolder" +cmd.exe /C cd /d "$currentLocation" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch" "&" mc.exe -o -d -c -U $($_.FullName) -h "$nativeResourcesFolder" -r "$nativeResourcesFolder" "@ log " Executing mc.exe Command: $command" Start-NativeExecution { Invoke-Expression -Command:$command } diff --git a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs index f2b3050585..468734b335 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs @@ -255,7 +255,6 @@ namespace System.Management.Automation.Runspaces get { int i = ReadRegistryInt("PipelineMaxStackSizeMB", 10); - if (i < 10) i = 10; // minimum 10MB else if (i > 100) @@ -536,35 +535,35 @@ namespace System.Management.Automation.Runspaces // Removed HandleUnexpectedExceptions infrastructure internal static int ReadRegistryInt(string policyValueName, int defaultValue) - { - RegistryKey key; - try - { - key = Registry.LocalMachine.OpenSubKey(Utils.GetRegistryConfigurationPrefix()); - } - catch (System.Security.SecurityException) - { - return defaultValue; - } - if (null == key) - return defaultValue; - - object temp; - try - { - temp = key.GetValue(policyValueName); - } - catch (System.Security.SecurityException) - { - return defaultValue; - } - if (!(temp is int)) - { - return defaultValue; - } - int i = (int)temp; - return i; - } + { + RegistryKey key; + try + { + key = Registry.LocalMachine.OpenSubKey(Utils.GetRegistryConfigurationPrefix()); + } + catch (System.Security.SecurityException) + { + return defaultValue; + } + if (null == key) + return defaultValue; + + object temp; + try + { + temp = key.GetValue(policyValueName); + } + catch (System.Security.SecurityException) + { + return defaultValue; + } + if (!(temp is int)) + { + return defaultValue; + } + int i = (int)temp; + return i; + } // NTRAID#Windows Out Of Band Releases-915506-2005/09/09 // Removed HandleUnexpectedExceptions infrastructure diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index d692a01fe3..f60feb16cc 100644 --- a/src/System.Management.Automation/project.json +++ b/src/System.Management.Automation/project.json @@ -197,9 +197,6 @@ "System.Management": "", "System.Configuration": "", "System.Configuration.Install": "" - }, - "dependencies": { - "Newtonsoft.Json": "7.0.1" } } } diff --git a/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt b/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt index 24fd4afe40..d8170fa41d 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt +++ b/src/powershell-native/nativemsh/pwrshcommon/CMakeLists.txt @@ -11,14 +11,12 @@ add_library(pwrshcommon target_include_directories(pwrshcommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if (BUILD_ONECORE) - message("Building OneCore version of pwrshcommon.lib") # Libraries to use when creating this binary for Windows on OneCore-based SKUs set(PWRSHCOMMON_WINDOWS_LIBS # onecore.lib ) set_target_properties(pwrshcommon PROPERTIES COMPILE_DEFINITIONS "CORECLR") else () # NOT BUILD_ONECORE - message("Building Full version of pwrshcommon.lib") # Libraries to use when creating this binary for Windows on full SKUs # Note: The appropriate libs get added automatically by VS set(PWRSHCOMMON_WINDOWS_LIBS