| 1 | #!/bin/bash |
|---|
| 2 | |
|---|
| 3 | ################################################################################ |
|---|
| 4 | # Copyright 2007 Sun Microsystems, Inc., |
|---|
| 5 | # 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
|---|
| 6 | # All rights reserved. |
|---|
| 7 | # |
|---|
| 8 | # U.S. Government Rights - Commercial software. |
|---|
| 9 | # Government users are subject to the Sun Microsystems, Inc. standard |
|---|
| 10 | # license agreement and applicable provisions of the FAR and its supplements. |
|---|
| 11 | # |
|---|
| 12 | # Use is subject to license terms. |
|---|
| 13 | # |
|---|
| 14 | # This distribution may include materials developed by third parties. |
|---|
| 15 | # |
|---|
| 16 | # Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered |
|---|
| 17 | # trademarks of Sun Microsystems, Inc. in the U.S. and other countries. |
|---|
| 18 | ################################################################################ |
|---|
| 19 | |
|---|
| 20 | # |
|---|
| 21 | # For NetBeans, you should not need to adjust anything to |
|---|
| 22 | # build and test Fortress. |
|---|
| 23 | # |
|---|
| 24 | # For Eclipse, workspace and ant builds should not require any |
|---|
| 25 | # adjustments, but to run tests using Ant within Eclipse, you |
|---|
| 26 | # will need to add junit.jar to |
|---|
| 27 | # build.xml -> Run As -> Ant Build... -> Classpath -> User Entries -> Add JARs... |
|---|
| 28 | # |
|---|
| 29 | |
|---|
| 30 | find_ant(){ |
|---|
| 31 | |
|---|
| 32 | # if $ANT_HOME is set then search for ant there |
|---|
| 33 | if [ "x$ANT_HOME" != "x" ]; then |
|---|
| 34 | if [ -x "$ANT_HOME/bin/ant" ]; then |
|---|
| 35 | echo $ANT_HOME/bin/ant |
|---|
| 36 | return |
|---|
| 37 | else |
|---|
| 38 | echo "Did not find ant in $ANT_HOME/bin" >&2 |
|---|
| 39 | fi |
|---|
| 40 | else |
|---|
| 41 | echo "ANT_HOME is not set" >&2 |
|---|
| 42 | fi |
|---|
| 43 | |
|---|
| 44 | # Otherwise use whatever is in $PATH |
|---|
| 45 | result=$(which ant 2>/dev/null) |
|---|
| 46 | if [ -z "$result" ]; then |
|---|
| 47 | echo "Could not find ant. You need to install it. See http://ant.apache.org/ for details." >&2 |
|---|
| 48 | exit 1 |
|---|
| 49 | fi |
|---|
| 50 | echo $result |
|---|
| 51 | exit 0 |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | ant_exec=$(find_ant) |
|---|
| 55 | n=$? |
|---|
| 56 | if [ $n -ne 0 ]; then |
|---|
| 57 | exit $n |
|---|
| 58 | fi |
|---|
| 59 | echo "Using $ant_exec" |
|---|
| 60 | $ant_exec -noclasspath -lib third_party/junit "$@" |
|---|