#! /bin/sh
set -e

ya make -E --dist
../bin/download_secret_for_local_use.py
MEM_OPTS="-Xmx1G"
JAVA_OPTS="$MEM_OPTS \
    -Dfile.encoding=UTF-8 \
    -Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true \
    -Dsun.net.inetaddr.ttl=60 -Dsun.net.inetaddr.negative.ttl=0 \
    -Djava.util.Arrays.useLegacyMergeSort=true \
    -XX:-UsePerfData
    -XX:+UseG1GC
    -XX:MaxGCPauseMillis=100"
JAVA_ARGS="$JAVA_OPTS -cp yandex-direct-web/*: -Djava.library.path=yandex-direct-web ru.yandex.direct.web.DirectWebApp"

ya tool java11 $JAVA_ARGS
