-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdeprecated_build.sh
executable file
·126 lines (110 loc) · 3.74 KB
/
deprecated_build.sh
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/sh
#
#=========================================================================
# Copyright 2001-2004 The Apache Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=========================================================================
#
# Name: build.sh
# Author: Shane Curcuru
echo "build.sh beginning..."
if [ "$1" = "-h" ] ; then
echo build.sh - executes Xalan Java-based test automation
echo Usage: build [target] [-D options]
echo Example: build api -DtestClass=TransformerAPITest -Dqetest.loggingLevel=30
exit 1
fi
CLS_PATH_SEP=:
# if we're on windows, override that:
uname | grep WIN && CLS_PATH_SEP=\;
# If PARSER_JAR is not set, default to xercesImpl.jar
if [ "$PARSER_JAR" = "" ] ; then
PARSER_JAR=../java/lib/xercesImpl.jar
fi
if [ "$XML_APIS_JAR" = "" ]; then
XML_APIS_JAR=../java/lib/xml-apis.jar
fi
if [ "$SERIALIZER_JAR" = "" ]; then
SERIALIZER_JAR=../java/lib/serializer.jar
fi
if [ "$ANT_HOME" = "" ] ; then
# try to find ANT
if [ -d /opt/ant ] ; then
ANT_HOME=/opt/ant
elif [ -d ${HOME}/opt/ant ] ; then
ANT_HOME=${HOME}/opt/ant
else
# Otherwise, just default the one over in java
ANT_HOME=../java
fi
fi
if [ "$JAVA_HOME" != "" ] ; then
if [ "$JAVACMD" = "" ] ; then
JAVACMD=$JAVA_HOME/bin/java
fi
else
if [ "$JAVACMD" = "" ] ; then
JAVACMD=java
fi
fi
# add in the dependency .jar files (copied from ant)
DIRLIBS=${ANT_HOME}/lib/*.jar
_ANT_CP=$ANT_HOME/tools/ant.jar
for i in ${DIRLIBS}
do
# if the directory is empty, then it will return the input string
# this is stupid, so check for it
if [ "$i" != "${DIRLIBS}" ] ; then
_ANT_CP=$_ANT_CP${CLS_PATH_SEP}"$i"
fi
done
# If JARDIR is set, prepend all .jars there to our classpath
if [ "$JARDIR" != "" ] ; then
CLASSPATH=${_ANT_CP}${CLS_PATH_SEP}${CLASSPATH}
DIRLIBS=${JARDIR}/*.jar
for i in ${DIRLIBS}
do
if [ "$i" != "${DIRLIBS}" ] ; then
CLASSPATH="$i"${CLS_PATH_SEP}${CLASSPATH}
fi
done
else
CLASSPATH=${CLASSPATH}${CLS_PATH_SEP}${_ANT_CP}${CLS_PATH_SEP}${PARSER_JAR}${CLS_PATH_SEP}${XML_APIS_JAR}${CLS_PATH_SEP}${SERIALIZER_JAR}
fi
if [ "$JAVA_HOME" != "" ] ; then
if test -f $JAVA_HOME/lib/tools.jar ; then
CLASSPATH=${CLASSPATH}${CLS_PATH_SEP}${JAVA_HOME}/lib/tools.jar
fi
if test -f $JAVA_HOME/lib/classes.zip ; then
CLASSPATH="${CLASSPATH}${CLS_PATH_SEP}${JAVA_HOME}/lib/classes.zip"
fi
else
echo "Warning: JAVA_HOME environment variable is not set."
echo " If build fails because sun.* classes could not be found"
echo " you will need to set the JAVA_HOME environment variable"
echo " to the installation directory of java."
fi
# supply JIKESPATH to Ant as jikes.class.path
if [ "$JIKESPATH" != "" ] ; then
if [ "$ANT_OPTS" != "" ] ; then
ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
else
ANT_OPTS=-Djikes.class.path=$JIKESPATH
fi
fi
# also pass along the selected parser to Ant
ANT_OPTS="${ANT_OPTS} -Dparserjar=${PARSER_JAR}"
echo Running: $JAVACMD ${JAVA_OPTS} -classpath "${CLASSPATH}" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main "$@"
$JAVACMD ${JAVA_OPTS} -classpath "${CLASSPATH}" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main "$@"
echo "build.sh complete!"