Skip to content

Commit

Permalink
setup-hook: add java heap size and change encoding by default for pho…
Browse files Browse the repository at this point in the history
…ebus
  • Loading branch information
Matthieu Daniel-Thomas committed Jun 4, 2024
1 parent 7bb74b6 commit 6f455bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkgs/epnix/tools/phoebus/setup-hook/setup-hook.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# shellcheck shell=bash


installPhoebusJar() {
local path="$1"
local jarName="$2"
local name="$3"
local mainClass="$4"
local D='"file.encoding=UTF-8"'


mkdir -p "$out/share/java"

Expand All @@ -23,5 +26,10 @@ installPhoebusJar() {
makeWrapper "@jdk@/bin/java" "$out/bin/$name" \
--add-flags "-classpath $out/share/java/$jarName:$depsPath/*" \
--add-flags '${JAVA_OPTS}' \
--add-flags "$mainClass"
--add-flags "$mainClass" \
--set-default JAVA_XMS "1G" \
--set-default JAVA_XMX "4G" \
--add-flags '-Xms$JAVA_XMS' \
--add-flags '-Xmx$JAVA_XMX' \
--add-flags "-D${D[@]}"
}

0 comments on commit 6f455bf

Please sign in to comment.