forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Check for cmake, g++, and dotnet programs. - Check for project.lock.json. - Check that libpsl-native was compiled.
- Loading branch information
1 parent
15e01bd
commit 3f37dfa
Showing
1 changed file
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
export BIN=$(pwd)/bin | ||
mkdir -p $BIN | ||
# Test for build dependencies | ||
hash cmake 2>/dev/null || { echo >&2 "No cmake, please run 'sudo apt-get install cmake'"; exit 1; } | ||
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; } | ||
|
||
# Build native components | ||
# 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; } | ||
|
||
# Ensure output directory is made | ||
BIN="$(pwd)/bin" | ||
mkdir -p "$BIN" | ||
|
||
# Build native library and deploy to bin | ||
pushd src/libpsl-native | ||
cmake -DCMAKE_BUILD_TYPE=Debug . | ||
make -j | ||
ctest -V | ||
cp src/libpsl-native.* $BIN | ||
test -r src/libpsl-native.* || { echo >&2 "Compilation of libpsl-native failed"; exit 3; } | ||
cp src/libpsl-native.* "$BIN" | ||
popd | ||
|
||
# Publish PowerShell | ||
dotnet publish --output $BIN --configuration Linux src/Microsoft.PowerShell.Linux.Host | ||
# Publish PowerShell to bin, with LINUX defined through a configuration | ||
dotnet publish --output "$BIN" --configuration Linux src/Microsoft.PowerShell.Linux.Host |