Skip to content

Commit 35f50c6

Browse files
committed
Update the tinystruct version to be 1.1.7.
1 parent 36cfe30 commit 35f50c6

3 files changed

Lines changed: 142 additions & 5 deletions

File tree

bin/dispatcher

Lines changed: 140 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22
ROOT="$(pwd)"
3-
VERSION="1.1.6"
3+
VERSION="1.1.7"
44
cd "$(dirname "$0")" || exit
55
cd "../"
66
# Navigate to the root directory
@@ -35,8 +35,145 @@ for jar_file in "$ROOT"/lib/tinystruct-"$VERSION".jar; do
3535
[ -f "$jar_file" ] && JAR_FILE="$JAR_FILE$jar_file:"
3636
done
3737

38+
# OS specific support. $var _must_ be set to either true or false.
39+
cygwin=false;
40+
darwin=false;
41+
mingw=false
42+
case "`uname`" in
43+
CYGWIN*) cygwin=true ;;
44+
MINGW*) mingw=true;;
45+
Darwin*) darwin=true
46+
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
47+
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
48+
if [ -z "$JAVA_HOME" ]; then
49+
if [ -x "/usr/libexec/java_home" ]; then
50+
export JAVA_HOME="`/usr/libexec/java_home`"
51+
else
52+
export JAVA_HOME="/Library/Java/Home"
53+
fi
54+
fi
55+
;;
56+
esac
57+
58+
if [ -z "$JAVA_HOME" ] ; then
59+
if [ -r /etc/gentoo-release ] ; then
60+
JAVA_HOME=`java-config --jre-home`
61+
fi
62+
fi
63+
64+
if [ -z "$M2_HOME" ] ; then
65+
## resolve links - $0 may be a link to maven's home
66+
PRG="$0"
67+
68+
# need this for relative symlinks
69+
while [ -h "$PRG" ] ; do
70+
ls=`ls -ld "$PRG"`
71+
link=`expr "$ls" : '.*-> \(.*\)$'`
72+
if expr "$link" : '/.*' > /dev/null; then
73+
PRG="$link"
74+
else
75+
PRG="`dirname "$PRG"`/$link"
76+
fi
77+
done
78+
79+
saveddir=`pwd`
80+
81+
M2_HOME=`dirname "$PRG"`/..
82+
83+
# make it fully qualified
84+
M2_HOME=`cd "$M2_HOME" && pwd`
85+
86+
cd "$saveddir"
87+
# echo Using m2 at $M2_HOME
88+
fi
89+
90+
# For Cygwin, ensure paths are in UNIX format before anything is touched
91+
if $cygwin ; then
92+
[ -n "$M2_HOME" ] &&
93+
M2_HOME=`cygpath --unix "$M2_HOME"`
94+
[ -n "$JAVA_HOME" ] &&
95+
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
96+
[ -n "$CLASSPATH" ] &&
97+
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
98+
fi
99+
100+
# For Migwn, ensure paths are in UNIX format before anything is touched
101+
if $mingw ; then
102+
[ -n "$M2_HOME" ] &&
103+
M2_HOME="`(cd "$M2_HOME"; pwd)`"
104+
[ -n "$JAVA_HOME" ] &&
105+
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
106+
# TODO classpath?
107+
fi
108+
109+
if [ -z "$JAVA_HOME" ]; then
110+
javaExecutable="`which javac`"
111+
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
112+
# readlink(1) is not available as standard on Solaris 10.
113+
readLink=`which readlink`
114+
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
115+
if $darwin ; then
116+
javaHome="`dirname \"$javaExecutable\"`"
117+
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
118+
else
119+
javaExecutable="`readlink -f \"$javaExecutable\"`"
120+
fi
121+
javaHome="`dirname \"$javaExecutable\"`"
122+
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
123+
JAVA_HOME="$javaHome"
124+
export JAVA_HOME
125+
fi
126+
fi
127+
fi
128+
129+
if [ -z "$JAVACMD" ] ; then
130+
if [ -n "$JAVA_HOME" ] ; then
131+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
132+
# IBM's JDK on AIX uses strange locations for the executables
133+
JAVACMD="$JAVA_HOME/jre/sh/java"
134+
else
135+
JAVACMD="$JAVA_HOME/bin/java"
136+
fi
137+
else
138+
JAVACMD="`which java`"
139+
fi
140+
fi
141+
142+
if [ ! -x "$JAVACMD" ] ; then
143+
echo "Error: JAVA_HOME is not defined correctly." >&2
144+
echo " We cannot execute $JAVACMD" >&2
145+
exit 1
146+
fi
147+
148+
if [ -z "$JAVA_HOME" ] ; then
149+
echo "Warning: JAVA_HOME environment variable is not set."
150+
fi
151+
152+
# For Cygwin, switch paths to Windows format before running java
153+
if $cygwin; then
154+
[ -n "$M2_HOME" ] &&
155+
M2_HOME=`cygpath --path --windows "$M2_HOME"`
156+
[ -n "$JAVA_HOME" ] &&
157+
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
158+
[ -n "$CLASSPATH" ] &&
159+
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
160+
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
161+
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
162+
fi
163+
164+
# Check if M2_HOME is not set or is equal to the current project path
165+
if [ -z "$M2_HOME" ] || [ "$M2_HOME" = "$(pwd)" ]; then
166+
# Set M2_HOME to the .m2 folder under the user's home directory
167+
M2_HOME="$HOME/.m2"
168+
fi
169+
170+
# Add all JAR files under the lib folder to the classpath
171+
for jar_file in "$ROOT"/lib/*.jar; do
172+
CLASSPATH="$CLASSPATH:$jar_file"
173+
done
174+
38175
# Java execution
39-
java \
176+
$JAVACMD \
40177
$JAVA_OPTS \
41178
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/ \
42-
-cp "$ROOT/target/classes:$JAR_FILE$ROOT/lib/*:$ROOT/WEB-INF/lib/*:$ROOT/WEB-INF/classes:$HOME/.m2/repository/org/tinystruct/tinystruct/$VERSION/tinystruct-$VERSION-jar-with-dependencies.jar" org.tinystruct.system.Dispatcher "$@"
179+
-cp "$ROOT/target/classes:$JAR_FILE$CLASSPATH:$ROOT/WEB-INF/lib/*:$ROOT/WEB-INF/classes:$M2_HOME/repository/org/tinystruct/tinystruct/$VERSION/tinystruct-$VERSION-jar-with-dependencies.jar" org.tinystruct.system.Dispatcher "$@"

bin/dispatcher.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
@rem ***************************************************************************
1616
@echo off
1717
set "ROOT=%~dp0..\"
18-
set "VERSION=1.1.6"
18+
set "VERSION=1.1.7"
1919
set "classpath=%ROOT%target\classes:%ROOT%lib\*:%ROOT%WEB-INF\lib\*:%ROOT%WEB-INF\classes":%classpath%
2020
@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 %*

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>org.tinystruct</groupId>
2323
<artifactId>tinystruct</artifactId>
24-
<version>1.1.6</version>
24+
<version>1.1.7</version>
2525
</dependency>
2626
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
2727
<dependency>

0 commit comments

Comments
 (0)