Merge pull request #748 from PowerShell/dotnet-run

Enable `dotnet-run`
This commit is contained in:
Andy Schwartzmeyer
2016-03-29 12:33:50 -07:00
6 changed files with 14 additions and 19 deletions
+1 -2
View File
@@ -145,7 +145,7 @@ function Start-PSBuild
$Ext = if ($IsLinux) { "so" } elseif ($IsOSX) { "dylib" }
$Native = "$PSScriptRoot/src/libpsl-native"
$Lib = "$Native/src/libpsl-native.$Ext"
$Lib = "$Top/libpsl-native.$Ext"
Write-Verbose "Building $Lib"
try {
@@ -158,7 +158,6 @@ function Start-PSBuild
}
if (-Not (Test-Path $Lib)) { throw "Compilation of $Lib failed" }
Copy-Item $Lib $Output
}
}
else
+7 -5
View File
@@ -5,8 +5,10 @@ hash cmake 2>/dev/null || { echo >&2 "No cmake, please run 'sudo apt-get install
hash g++ 2>/dev/null || { echo >&2 "No g++, please run 'sudo apt-get install g++'"; exit 1; }
hash dotnet 2>/dev/null || { echo >&2 "No dotnet, please visit https://dotnet.github.io/getting-started/"; exit 1; }
TOP="$(pwd)/src/Microsoft.PowerShell.Linux.Host"
# Test for lock file
test -r src/Microsoft.PowerShell.Linux.Host/project.lock.json || { echo >&2 "Please run 'dotnet restore' to download .NET Core packages"; exit 2; }
test -r "$TOP/project.lock.json" || { echo >&2 "Please run 'dotnet restore' to download .NET Core packages"; exit 2; }
# Ensure output directory is made
BIN="$(pwd)/bin"
@@ -16,13 +18,13 @@ mkdir -p "$BIN"
pushd src/libpsl-native
cmake -DCMAKE_BUILD_TYPE=Debug .
make -j
ctest -V
test -r src/libpsl-native.* || { echo >&2 "Compilation of libpsl-native failed"; exit 3; }
cp src/libpsl-native.* "$BIN"
make test
popd
test -r $TOP/libpsl-native.* || { echo >&2 "Compilation of libpsl-native failed"; exit 3; }
# Publish PowerShell to bin, with LINUX defined through a configuration
dotnet publish --output "$BIN" --configuration Linux src/Microsoft.PowerShell.Linux.Host
dotnet publish --output "$BIN" --configuration Linux "$TOP"
# Fix permissions for packaging
chmod -R go=u "$BIN"
@@ -0,0 +1 @@
*.a
@@ -19,7 +19,9 @@
"content": [
"Modules",
"PSL_profile.ps1"
"*_profile.ps1",
"*.so",
"*.dylib"
],
"frameworks": {
+1 -10
View File
@@ -8,21 +8,12 @@ hash dotnet 2>/dev/null || { echo >&2 "No dotnet, please visit https://dotnet.gi
# Test for lock file
test -r test/csharp/project.lock.json || { echo >&2 "Please run 'dotnet restore' to download .NET Core packages"; exit 2; }
# Build native components
pushd src/libpsl-native
cmake -DCMAKE_BUILD_TYPE=Debug .
make -j
ctest -V
## Work-around dotnet/cli#710
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/src"
popd
# Run xUnit tests
pushd test/csharp
## Build
dotnet build -c Linux
## Work-around dotnet/cli#753
cp -r ../../src/Microsoft.PowerShell.Linux.Host/Modules bin/Linux/netstandardapp1.5/ubuntu.14.04-x64
cp -r -f ../../src/Microsoft.PowerShell.Linux.Host/{Modules,*.so,*.dylib} bin/Linux/netstandardapp1.5/ubuntu.14.04-x64 2>/dev/null
## Test
dotnet test -c Linux
result=$?