corda/sgx-jvm/avian/test/ci.sh
Chris Rankin 56c7c91fee Squashed commit of the following: (#39)
commit 0347a6da462f724011c4078e9551800fa6455c56
Author: Joel Dice <joel.dice@gmail.com>
Date:   Mon Sep 11 10:49:39 2017 -0600

    attempt to fix Travis-CI build regression linked to Trusty upgrade

commit 06cae8a63c9a9b986b75d25b87af5e5a7610e0e5
Merge: 0056f2885 e94b191e6
Author: Joel Dice <joel.dice@gmail.com>
Date:   Mon Sep 11 10:41:58 2017 -0600

    Merge pull request #548 from corda/chrisr3-log-uncaught-exceptions

    Allow any uncaught exception to be logged as the thread exits.

commit 0056f2885285de374464436a9d6a6cea3a0e3c1b
Merge: a25c09bb7 7b3bedf0a
Author: Joel Dice <joel.dice@gmail.com>
Date:   Mon Sep 11 10:39:57 2017 -0600

    Merge pull request #549 from seanhenry/fix-string-builder

    Changes return type to StringBuilder

commit 7b3bedf0a4d16d837ec97cdac10dd86aef82953e
Author: Sean Henry <hello@seanhenry.codes>
Date:   Sun Sep 10 09:00:09 2017 -0700

    Changes return type to StringBuilder

commit e94b191e6dd83d86775079fa3dff218f7fe53005
Author: Chris Rankin <chris.rankin@r3.com>
Date:   Wed Sep 6 10:38:34 2017 +0100

    Allow any uncaught exception to be logged as the thread exits.
2017-09-11 22:41:06 +01:00

113 lines
2.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
root_dir=$(pwd)
flags="use-werror=true ${@}"
is-mac() {
if [[ $(uname -s) == "Darwin" || ${TRAVIS_OS_NAME} == "osx" ]]; then
return 0
fi
return 1
}
install-deps() {
if is-mac; then
echo "------ Installing dependencies for Mac ------"
else
echo "------ Installing dependencies for Linux ------"
sudo apt-get update -qq
sudo apt-get install -y libc6-dev-i386 mingw-w64 gcc-mingw-w64-x86-64 g++-mingw-w64-i686 binutils-mingw-w64-x86-64 lib32z1-dev zlib1g-dev g++-mingw-w64-x86-64
fi
}
run() {
echo '==============================================='
if [ ! $(pwd) = ${root_dir} ]; then
printf "cd $(pwd); "
fi
echo "${@}"
echo '==============================================='
"${@}"
}
run_cmake() {
mkdir -p cmake-build
rm -rf cmake-build/*
cd cmake-build
run cmake ${@} ..
run make -j4 check
cd ..
}
publish() {
local platforms="${1}"
local arches="${2}"
local platform
for platform in ${platforms}; do
local arch
for arch in ${arches}; do
echo "------ Publishing ${platform}-${arch} ------"
./gradlew artifactoryPublish -Pplatform=${platform} -Parch=${arch}
done
done
}
has_flag() {
local arg=${1}
local f
for f in ${flags}; do
local key=$(echo $f | awk -F '=' '{print $1}')
if [ ${key} = ${arg} ]; then
return 0
fi
done
return 1
}
### START ###
echo "java version:"
${JAVA_HOME}/bin/java -version
install-deps
if [[ "${1}" == "PUBLISH" ]]; then
if is-mac; then
publish "macosx" "i386 x86_64"
elif [[ $(uname -s) == "Linux" ]]; then
publish "linux windows" "i386 x86_64"
fi
else
if [[ $(uname -o) != "Cygwin" ]]; then
run_cmake -DCMAKE_BUILD_TYPE=Debug
fi
make_target=test
if ! has_flag arch; then
run make ${flags} jdk-test
fi
run make ${flags} ${make_target}
run make ${flags} mode=debug ${make_target}
run make ${flags} process=interpret ${make_target}
if has_flag openjdk-src || ! has_flag openjdk; then
run make ${flags} mode=debug bootimage=true ${make_target}
run make ${flags} bootimage=true ${make_target}
run make ${flags} bootimage=true bootimage-test=true ${make_target}
fi
if ! has_flag openjdk && ! has_flag android && ! has_flag arch; then
run make ${flags} openjdk=$JAVA_HOME ${make_target}
fi
run make ${flags} tails=true continuations=true heapdump=true ${make_target}
run make ${flags} codegen-targets=all
fi