This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
forked from mareknovotny/jboss-seam
-
Notifications
You must be signed in to change notification settings - Fork 50
/
seam
executable file
·61 lines (53 loc) · 2.23 KB
/
seam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
##############################################
# #
# seam-gen - Seam project and code generator #
# #
##############################################
# Validate the JDK installation
if [ -z "$JAVA_HOME" ]; then
echo "The JAVA_HOME environment variable is not set"
echo "Please point it to a JDK installation"
exit 1
elif [ ! -x "$JAVA_HOME/bin/javac" ]; then
echo "The JAVA_HOME environment variable should point to a JDK, not a JRE"
exit 1
fi
WORKING_DIR=$PWD
if [ -z "$SEAM_HOME" ]; then
if [ -h "$0" ]; then
SEAM_SCRIPT=`readlink "$0"`
else
SEAM_SCRIPT=$0
fi
# get the full path without any relative bits (not really necessary)
SEAM_SCRIPT_ABS_PATH=`readlink -f "$0" 2>/dev/null`
if [ $? -eq 0 ]; then
SEAM_SCRIPT=$SEAM_SCRIPT_ABS_PATH
fi
SEAM_HOME=`dirname "$SEAM_SCRIPT"`
fi
SEAM_GEN_DIR="$SEAM_HOME/seam-gen"
SEAM_COMMAND="$1"
echo "SEAM_HOME: $SEAM_HOME"
echo "Using seam-gen sources from: $SEAM_GEN_DIR"
cygwin=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;
esac
if [ -z "$SEAM_COMMAND" ]; then
cat "$SEAM_GEN_DIR/USAGE"
elif [ "$SEAM_COMMAND" = help ]; then
cat "$SEAM_GEN_DIR/README"
elif $cygwin; then
# Must pass real Windows paths to Java (Java doesn't execute in the context of cgywin)
JAVA_HOME_WINPATH=`cygpath -aw "$JAVA_HOME"`
SEAM_HOME_WINPATH=`cygpath -aw "$SEAM_HOME"`
SEAM_GEN_DIR_WINPATH=`cygpath -aw "$SEAM_GEN_DIR"`
WORKING_DIR_WINPATH=`cygpath -aw "$WORKING_DIR"`
"$JAVA_HOME/bin/java" -cp "$JAVA_HOME_WINPATH\lib\tools.jar;$SEAM_HOME_WINPATH\seam-gen\lib\ant-launcher.jar;$SEAM_HOME_WINPATH\lib\gen\ant-nodeps.jar;$SEAM_HOME_WINPATH\lib\gen\ant.jar" -Dant.home="$SEAM_HOME_WINPATH\lib" org.apache.tools.ant.launch.Launcher -buildfile "$SEAM_GEN_DIR_WINPATH\build.xml" -Dworking.dir="$WORKING_DIR_WINPATH" "$@"
else
"$JAVA_HOME/bin/java" -cp "$JAVA_HOME/lib/tools.jar:$SEAM_HOME/seam-gen/lib/ant-launcher.jar:$SEAM_HOME/seam-gen/lib/ant-nodeps.jar:$SEAM_HOME/seam-gen/lib/ant.jar" -Dant.home="$SEAM_HOME/lib" org.apache.tools.ant.launch.Launcher -buildfile "$SEAM_GEN_DIR/build.xml" -Dworking.dir="$WORKING_DIR" "$@"
fi