2015-01-02 19:52:36 +00:00
|
|
|
#!/usr/bin/env bash
|
2013-02-16 15:36:41 +00:00
|
|
|
|
2015-01-02 19:52:36 +00:00
|
|
|
set -eo pipefail
|
2013-02-16 15:36:41 +00:00
|
|
|
|
2014-07-13 01:06:41 +00:00
|
|
|
root_dir=$(pwd)
|
|
|
|
|
2016-02-15 22:39:31 +00:00
|
|
|
flags="use-werror=true ${@}"
|
2015-01-02 19:52:36 +00:00
|
|
|
|
2015-01-05 18:31:01 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2014-05-09 21:16:55 +00:00
|
|
|
run() {
|
|
|
|
echo '==============================================='
|
2014-07-13 01:06:41 +00:00
|
|
|
if [ ! $(pwd) = ${root_dir} ]; then
|
|
|
|
printf "cd $(pwd); "
|
|
|
|
fi
|
2014-05-09 21:16:55 +00:00
|
|
|
echo "${@}"
|
|
|
|
echo '==============================================='
|
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
2014-07-13 01:06:41 +00:00
|
|
|
run_cmake() {
|
|
|
|
mkdir -p cmake-build
|
|
|
|
rm -rf cmake-build/*
|
|
|
|
cd cmake-build
|
|
|
|
run cmake ${@} ..
|
|
|
|
run make -j4 check
|
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
2015-01-02 19:52:36 +00:00
|
|
|
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
|
|
|
|
}
|
2014-08-15 21:29:53 +00:00
|
|
|
|
2014-08-17 19:56:13 +00:00
|
|
|
has_flag() {
|
2015-01-02 19:52:36 +00:00
|
|
|
local arg=${1}
|
|
|
|
|
|
|
|
local f
|
2014-08-15 21:29:53 +00:00
|
|
|
for f in ${flags}; do
|
|
|
|
local key=$(echo $f | awk -F '=' '{print $1}')
|
|
|
|
if [ ${key} = ${arg} ]; then
|
2014-08-17 19:56:13 +00:00
|
|
|
return 0
|
2014-08-15 21:29:53 +00:00
|
|
|
fi
|
|
|
|
done
|
2014-08-17 19:56:13 +00:00
|
|
|
return 1
|
2014-08-15 21:29:53 +00:00
|
|
|
}
|
|
|
|
|
2015-01-05 18:31:01 +00:00
|
|
|
### START ###
|
|
|
|
|
2017-09-11 21:41:06 +00:00
|
|
|
echo "java version:"
|
|
|
|
${JAVA_HOME}/bin/java -version
|
|
|
|
|
2015-01-05 18:31:01 +00:00
|
|
|
install-deps
|
2014-08-17 19:56:13 +00:00
|
|
|
|
2015-01-02 23:52:15 +00:00
|
|
|
if [[ "${1}" == "PUBLISH" ]]; then
|
2015-01-05 18:31:01 +00:00
|
|
|
if is-mac; then
|
2015-01-02 23:52:15 +00:00
|
|
|
publish "macosx" "i386 x86_64"
|
|
|
|
elif [[ $(uname -s) == "Linux" ]]; then
|
|
|
|
publish "linux windows" "i386 x86_64"
|
2015-01-02 19:52:36 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [[ $(uname -o) != "Cygwin" ]]; then
|
|
|
|
run_cmake -DCMAKE_BUILD_TYPE=Debug
|
|
|
|
fi
|
2014-07-13 01:06:41 +00:00
|
|
|
|
2015-01-05 18:31:01 +00:00
|
|
|
make_target=test
|
|
|
|
|
2015-03-16 22:47:24 +00:00
|
|
|
if ! has_flag arch; then
|
|
|
|
run make ${flags} jdk-test
|
|
|
|
fi
|
|
|
|
|
2015-01-02 19:52:36 +00:00
|
|
|
run make ${flags} ${make_target}
|
|
|
|
run make ${flags} mode=debug ${make_target}
|
|
|
|
run make ${flags} process=interpret ${make_target}
|
2014-08-17 19:56:13 +00:00
|
|
|
|
2015-03-16 22:47:24 +00:00
|
|
|
if has_flag openjdk-src || ! has_flag openjdk; then
|
|
|
|
run make ${flags} mode=debug bootimage=true ${make_target}
|
2015-01-02 19:52:36 +00:00
|
|
|
run make ${flags} bootimage=true ${make_target}
|
2015-10-19 21:10:53 +00:00
|
|
|
run make ${flags} bootimage=true bootimage-test=true ${make_target}
|
2015-03-16 22:47:24 +00:00
|
|
|
fi
|
2014-08-15 21:29:53 +00:00
|
|
|
|
2015-03-16 22:47:24 +00:00
|
|
|
if ! has_flag openjdk && ! has_flag android && ! has_flag arch; then
|
2015-01-02 19:52:36 +00:00
|
|
|
run make ${flags} openjdk=$JAVA_HOME ${make_target}
|
2015-03-16 22:47:24 +00:00
|
|
|
fi
|
2014-08-15 21:29:53 +00:00
|
|
|
|
2015-01-02 19:52:36 +00:00
|
|
|
run make ${flags} tails=true continuations=true heapdump=true ${make_target}
|
|
|
|
run make ${flags} codegen-targets=all
|
|
|
|
fi
|