| 1 |
#!/bin/sh |
| 2 |
# ----------------------------------------------------------------------------- |
| 3 |
# |
| 4 |
# Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 |
# contributor license agreements. See the NOTICE file distributed with |
| 6 |
# this work for additional information regarding copyright ownership. |
| 7 |
# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 8 |
# (the "License"); you may not use this file except in compliance with |
| 9 |
# the License. You may obtain a copy of the License at |
| 10 |
# |
| 11 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
# |
| 13 |
# Unless required by applicable law or agreed to in writing, software |
| 14 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 15 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 |
# See the License for the specific language governing permissions and |
| 17 |
# limitations under the License. |
| 18 |
# |
| 19 |
# build.sh - Unix Build Script for Rasterizer Task |
| 20 |
# |
| 21 |
# $Id$ |
| 22 |
# -------------------------------------------------------------------------- |
| 23 |
|
| 24 |
# ----- Verify and Set Required Environment Variables ------------------------- |
| 25 |
|
| 26 |
if [ "$ANT_HOME" = "" ] ; then |
| 27 |
ANT_HOME=../.. |
| 28 |
fi |
| 29 |
|
| 30 |
if [ "$JAVA_HOME" = "" ] ; then |
| 31 |
echo You must set JAVA_HOME to point at your Java Development Kit installation |
| 32 |
exit 1 |
| 33 |
fi |
| 34 |
|
| 35 |
# OS specific support. $var _must_ be set to either true or false. |
| 36 |
cygwin=false; |
| 37 |
case "`uname`" in |
| 38 |
CYGWIN*) cygwin=true ;; |
| 39 |
esac |
| 40 |
|
| 41 |
# For Cygwin, ensure paths are in UNIX format before anything is touched |
| 42 |
if $cygwin ; then |
| 43 |
[ -n "$JAVA_HOME" ] && |
| 44 |
JAVA_HOME=`cygpath --unix "$JAVA_HOME"` |
| 45 |
fi |
| 46 |
|
| 47 |
|
| 48 |
BATIK_HOME=../.. |
| 49 |
|
| 50 |
|
| 51 |
# ----- Set up classpath --------------------------------------------------- |
| 52 |
|
| 53 |
CP=$JAVA_HOME/lib/tools.jar:$ANT_HOME/lib/build/ant-1.9.3.jar:$ANT_HOME/lib/build/ant-launcher-1.9.3.jar:$BATIK_HOME/lib/build/crimson-1.1.3.jar |
| 54 |
|
| 55 |
CP=$CP:$BATIK_HOME/classes |
| 56 |
|
| 57 |
if $cygwin; then |
| 58 |
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` |
| 59 |
CP=`cygpath --path --windows "$CP"` |
| 60 |
fi |
| 61 |
|
| 62 |
# ----- Execute The Requested Build ------------------------------------------- |
| 63 |
|
| 64 |
TARGET=$1; |
| 65 |
if [ $# != 0 ] ; then |
| 66 |
shift 1 |
| 67 |
fi |
| 68 |
|
| 69 |
"$JAVA_HOME/bin/java" $ANT_OPTS -classpath "$CP" org.apache.tools.ant.Main -emacs -Dant.home=$ANT_HOME $TARGET -Dargs="$*" |
| 70 |
|
| 71 |
|
| 72 |
# ----- Cleanup the environment -------------------------------------------- |
| 73 |
|
| 74 |
|
| 75 |
BATIK_HOME= |
| 76 |
CP= |
| 77 |
|