diff options
author | chriseth <chris@ethereum.org> | 2018-12-10 23:02:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-10 23:02:30 +0800 |
commit | 055c5fe173b90b7d07f1170de5d7018140296f89 (patch) | |
tree | b8ea14cb2c2b4edb1dd3ab1358d115da6090a079 | |
parent | 0300e09d3e4f818de7e770bb2d60b0285ae38e91 (diff) | |
parent | a3829516f05adc37da77d02b84d578a386f8ecc2 (diff) | |
download | dexon-solidity-055c5fe173b90b7d07f1170de5d7018140296f89.tar.gz dexon-solidity-055c5fe173b90b7d07f1170de5d7018140296f89.tar.zst dexon-solidity-055c5fe173b90b7d07f1170de5d7018140296f89.zip |
Merge pull request #5610 from ethereum/shell-script-cleanups
build.sh bash script cleanup
-rwxr-xr-x | scripts/build.sh | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index bddbb97a..6edd60bd 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,28 +1,26 @@ #!/usr/bin/env bash +set -e -if [ -z "$1" ]; then +ROOTDIR="$(dirname "$0")/.." +BUILDDIR="${ROOTDIR}/build" + +if [[ $# -eq 0 ]]; then BUILD_TYPE=Release else BUILD_TYPE="$1" fi -cd $(dirname "$0")/.. && - if [[ "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]; then - touch prerelease.txt + touch "${ROOTDIR}/prerelease.txt" fi -mkdir -p build && -cd build && -cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" && -make -j2 +mkdir -p "${BUILDDIR}" +cd "${BUILDDIR}" -if [ $? -ne 0 ]; then - echo "Failed to build" - exit 1 -fi +cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}" +make -j2 -if [ -z $CI ]; then - echo "Installing solc and soltest" - install solc/solc /usr/local/bin && install test/soltest /usr/local/bin +if [[ "${CI}" == "" ]]; then + echo "Installing ..." + sudo make install fi |