mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
9abba8fe24
This option specifies that the test classes should be AOT-compiled
along with the class library, which allows us to test that everything
works in AOT-compiled form as well as JIT-compiled form. This is
primarily motivated by the need to test d906db6
(support for
AOT-compilation of Java 8 lambda expressions).
Note that I had to tweak Misc because it tested something that
couldn't be done in an AOT build without a lot of extra work, and
SystemClassLoader.getPackage because it was returning null when the
requested package could not be populated with JAR manifest metadata.
Technically, we probably *should* return null for packages that don't
exist at all (in the sense that no classes have been loaded from such
a package), but tracking that kind of thing seems like more trouble
than it's worth unless someone complains about it.
110 lines
2.3 KiB
Bash
Executable File
110 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
root_dir=$(pwd)
|
|
|
|
flags="${@}"
|
|
|
|
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 ###
|
|
|
|
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
|