From 03c452c98ced868a6dd8eb1c4b5bbbfbb83a965a Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 28 Mar 2016 13:58:00 -0700 Subject: [PATCH] Deploy native library automatically --- PowerShellGitHubDev.psm1 | 3 +-- src/Microsoft.PowerShell.Linux.Host/.gitignore | 1 + src/Microsoft.PowerShell.Linux.Host/project.json | 4 +++- xunit.sh | 11 +---------- 4 files changed, 6 insertions(+), 13 deletions(-) create mode 100644 src/Microsoft.PowerShell.Linux.Host/.gitignore diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 555f14e00..0375d2a8d 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -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 diff --git a/src/Microsoft.PowerShell.Linux.Host/.gitignore b/src/Microsoft.PowerShell.Linux.Host/.gitignore new file mode 100644 index 000000000..aa00c4e67 --- /dev/null +++ b/src/Microsoft.PowerShell.Linux.Host/.gitignore @@ -0,0 +1 @@ +*.a \ No newline at end of file diff --git a/src/Microsoft.PowerShell.Linux.Host/project.json b/src/Microsoft.PowerShell.Linux.Host/project.json index c24629b4b..bb59090d3 100644 --- a/src/Microsoft.PowerShell.Linux.Host/project.json +++ b/src/Microsoft.PowerShell.Linux.Host/project.json @@ -19,7 +19,9 @@ "content": [ "Modules", - "PSL_profile.ps1" + "*_profile.ps1", + "*.so", + "*.dylib" ], "frameworks": { diff --git a/xunit.sh b/xunit.sh index f20e31bb2..2813b4274 100755 --- a/xunit.sh +++ b/xunit.sh @@ -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=$?