Skip to content

Commit

Permalink
Update the tinystruct version to be 1.1.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ver committed Feb 11, 2024
1 parent a70b57b commit fa9d54e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
44 changes: 29 additions & 15 deletions bin/dispatcher
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
#!/usr/bin/env sh
ROOT="$(pwd)"
VERSION="1.1.4"
VERSION="1.1.6"
cd "$(dirname "$0")" || exit
cd "../"
# Navigate to the root directory
cd "$ROOT" || exit

# Java options initialization
JAVA_OPTS=""

# Arguments initialization
args=""
for arg
do
str=$(echo "$arg" | awk '{ string=substr($0, 0, 2); print string; }' )
if [ "$str" = "-D" -o "$str" = "-X" ]
then
JAVA_OPTS=$JAVA_OPTS" "$arg
else
args=$args" "$arg
fi

# Loop through each argument
for arg; do
# Extract the first two characters of the argument
str=${arg:0:2}

# Check if it starts with '-D' or '-X'
if [ "$str" = "-D" ] || [ "$str" = "-X" ]; then
JAVA_OPTS="$JAVA_OPTS $arg"
else
args="$args $arg"
fi
done

# Check if the JAR file exists
JAR_FILE="$ROOT/lib/tinystruct-$VERSION-jar-with-dependencies.jar"
if [ ! -f "$JAR_FILE" ]; then
JAR_FILE=""
else
JAR_FILE=$JAR_FILE":"
fi
[ -f "$JAR_FILE" ] && JAR_FILE="$JAR_FILE:"

# Check if additional JAR files exist and add them to the classpath
# shellcheck disable=SC2043
for jar_file in "$ROOT"/lib/tinystruct-"$VERSION".jar; do
[ -f "$jar_file" ] && JAR_FILE="$JAR_FILE$jar_file:"
done

# Java execution
java \
$JAVA_OPTS \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/ \
Expand Down
2 changes: 1 addition & 1 deletion bin/dispatcher.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
@rem ***************************************************************************
@echo off
set "ROOT=%~dp0..\"
set "VERSION=1.1.4"
set "VERSION=1.1.6"
set "classpath=%ROOT%target\classes:%ROOT%lib\*:%ROOT%WEB-INF\lib\*:%ROOT%WEB-INF\classes":%classpath%
@java -cp "%ROOT%target\classes;%ROOT%lib\tinystruct-%VERSION%-jar-with-dependencies.jar;%ROOT%lib\*;%ROOT%WEB-INF\lib\*;%ROOT%WEB-INF\classes;%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct\%VERSION%\tinystruct-%VERSION%-jar-with-dependencies.jar" org.tinystruct.system.Dispatcher %*
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<dependency>
<groupId>org.tinystruct</groupId>
<artifactId>tinystruct</artifactId>
<version>1.1.4</version>
<classifier>jar-with-dependencies</classifier>
<version>1.1.6</version>
<!-- <classifier>jar-with-dependencies</classifier>-->
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
Expand Down

0 comments on commit fa9d54e

Please sign in to comment.