Merge pull request #780 from PowerShell/andschwa/deprecate-build.sh
Deprecate build.sh script
This commit is contained in:
commit
6503f74bdd
1 changed files with 6 additions and 28 deletions
34
build.sh
34
build.sh
|
@ -1,30 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Test for build dependencies
|
if hash powershell 2>/dev/null; then
|
||||||
hash cmake 2>/dev/null || { echo >&2 "No cmake, please run 'sudo apt-get install cmake'"; exit 1; }
|
echo 'Continuing with `powershell -c Start-PSBuild`'
|
||||||
hash g++ 2>/dev/null || { echo >&2 "No g++, please run 'sudo apt-get install g++'"; exit 1; }
|
powershell -c Start-PSBuild
|
||||||
hash dotnet 2>/dev/null || { echo >&2 "No dotnet, please visit https://dotnet.github.io/getting-started/"; exit 1; }
|
else
|
||||||
|
echo 'No `powershell`, see docs/building/linux.md or osx.md to build PowerShell!'
|
||||||
TOP="$(pwd)/src/Microsoft.PowerShell.Host"
|
fi
|
||||||
|
|
||||||
# Test for lock file
|
|
||||||
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"
|
|
||||||
mkdir -p "$BIN"
|
|
||||||
|
|
||||||
# Build native library and deploy to bin
|
|
||||||
pushd src/libpsl-native
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug .
|
|
||||||
make -j
|
|
||||||
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 "$TOP"
|
|
||||||
|
|
||||||
# Fix permissions for packaging
|
|
||||||
chmod -R go=u "$BIN"
|
|
||||||
|
|
Loading…
Reference in a new issue