GP-6193: Environment variables can now be set in launch.properties using ENVVARS= or ENVVARS_[PLATFORM]=

This commit is contained in:
Ryan Kurtz
2025-12-12 11:00:56 -05:00
parent 529fc65639
commit 02567fd355
6 changed files with 85 additions and 8 deletions
+12 -3
View File
@@ -43,9 +43,9 @@ function showUsage() {
exit 1
}
VMARGS_FROM_CALLER= # Passed in from the outer script as one long string, no spaces
VMARGS_FROM_LAUNCH_SH=() # Defined in this script, added to array
VMARGS_FROM_LAUNCH_PROPS=() # Retrieved from LaunchSupport, added to array
VMARGS_FROM_CALLER= # Passed in from the outer script as one long string, no spaces
VMARGS_FROM_LAUNCH_SH=() # Defined in this script, added to array
VMARGS_FROM_LAUNCH_PROPS=() # Retrieved from LaunchSupport, added to array
ARGS=()
INDEX=0
@@ -169,6 +169,15 @@ if [ ! $? -eq 0 ]; then
fi
JAVA_CMD="${LS_JAVA_HOME}/bin/java"
# Get the configurable environment variables from the launch properties
# Only set them if they are currently unset or empty
while IFS=$'\r\n' read -r line; do
IFS='=' read -r key value <<< "$line"
if [ -z ${!key} ]; then
export $key=$value
fi
done < <("${JAVA_CMD}" -cp "${LS_CPATH}" LaunchSupport "${INSTALL_DIR}" -envvars)
# Get the configurable VM arguments from the launch properties
while IFS=$'\r\n' read -r line; do
VMARGS_FROM_LAUNCH_PROPS+=("$line")