Eliminate dependency on native host for shell

PSRP will of course still require it, but now the managed host sets up
the assembly load context, meaning we can depend on the emitted binary
from dotnet-cli.
This commit is contained in:
Andrew Schwartzmeyer
2015-12-23 16:53:09 -08:00
parent 124fe201bf
commit d5f5645f4d
5 changed files with 9 additions and 7 deletions
+1 -2
View File
@@ -1,2 +1 @@
export CORE_ROOT=$(pwd)/bin
lldb-3.6 -o "plugin load ./bin/libsosplugin.so" -- ./powershell $@
lldb-3.6 -o "plugin load ./bin/libsosplugin.so" -- ./bin/Microsoft.PowerShell.Linux.Host $@
+1 -2
View File
@@ -1,5 +1,4 @@
export CORE_ROOT=$(pwd)/bin
./powershell -c "Invoke-Pester src/pester-tests/$1 -OutputFile pester-tests.xml -OutputFormat NUnitXml"
./bin/Microsoft.PowerShell.Linux.Host -c "Invoke-Pester src/pester-tests/$1 -OutputFile pester-tests.xml -OutputFormat NUnitXml"
# XML files are not executable
chmod -x pester-tests.xml
# Fix tty due to possible bug in .NET
-1
View File
@@ -1 +0,0 @@
src/monad-native/host/powershell
+1 -2
View File
@@ -1,4 +1,3 @@
export CORE_ROOT=$(pwd)/bin
./powershell $@
./bin/Microsoft.PowerShell.Linux.Host $@
# Fix tty due to possible bug in .NET
stty echo
@@ -18,6 +18,12 @@ namespace Microsoft.PowerShell.Linux.Host
/// </summary>
public static void Main(string[] args)
{
// Setup the Assembly Load Context, which Core PowerShell uses to
// analyze the libraries for types, functions, cmdlets, etc. and
// provide the ability to load assemblies by file path. Doing this
// here eliminates the need for a custom native host.
PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(AppContext.BaseDirectory);
// Custom argument parsing
string initialScript = null;
if (args.Length > 0)