#!/bin/sh

export JAVA_HOME=$HOME/app/jre
export JAVA_BIN=$JAVA_HOME/bin/java

APP_HOME="$(cd "$(dirname "$0")/.." && pwd)"

export BIN_DIR="$APP_HOME/bin"
export CONF_DIR="$APP_HOME/conf"
export LOGS_DIR="$APP_HOME/logs"
export APPS_DIR="$APP_HOME/apps"

export APP_LIST="rota-local-server rota-local-client moct-local-client"
export APP_VER_ROTA_LOCAL_SERVER="0.0.1"
export APP_VER_ROTA_LOCAL_CLIENT="0.0.1"
export APP_VER_MOCT_LOCAL_CLIENT="0.0.1"

export APP_SERVER="$APPS_DIR/rota-local-server-$APP_VER_SERVER.jar"
export APP_CLIENT="$APPS_DIR/rota-local-client-$APP_VER_CLIENT.jar"
export APP_MOCT="$APPS_DIR/moct-local-client-$APP_VER_MOCT.jar"

export JAVA_OPTS_SERVER="-Xms512m -Xmx1024m -XX:+UseG1GC"
export JAVA_OPTS_CLIENT="-Xms1024m -Xmx2048m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"

export JAVA_OPTS_ROTA_LOCAL_SERVER="-Dspring.profiles.active=rota-local-server $JAVA_OPTS_SERVER"
export JAVA_OPTS_ROTA_LOCAL_CLIENT="-Dspring.profiles.active=rota-local-client $JAVA_OPTS_CLIENT"
export JAVA_OPTS_MOCT_LOCAL_CLIENT="-Dspring.profiles.active=moct-local-client $JAVA_OPTS_CLIENT"

export JAVA_OPTS_HEAPDUMP="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$LOGS_DIR/dumps"
