Allow using environment variable to set xmx flag

This commit is contained in:
Xeyame 2019-04-16 16:34:57 +02:00
parent e230cee91e
commit 7838adf833
No known key found for this signature in database
GPG Key ID: 9CECB1F48D92F8BE

View File

@ -16,7 +16,13 @@ ensure_buildtools() {
run_buildtools() { run_buildtools() {
ensure_buildtools ensure_buildtools
java -jar BuildTools.jar --rev $1 # Check if env var isnt empty, then run with xmx flag
if [ ! -z "$BUILDTOOLS_XMX" ]; then
echo "BUILDTOOLS_XMX Environment variable found. Running BuildTools with -Xmx$BUILDTOOLS_XMX"
java -Xmx$BUILDTOOLS_XMX -jar BuildTools.jar --rev $1
else
java -jar BuildTools.jar --rev $1
fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Running BuildTools for CB $1 failed! Aborting." echo "Running BuildTools for CB $1 failed! Aborting."
popd popd