= Suggested .antrc = Ant apparently does not check the current directory for configuration files, and instead checks only system directories and the user's home directory. After some thinking, we realized that with an appropriate (and simple) [source:trunk/antrc_suggested ~/.antrc], configuration files could be read from the current directory, even system-specific configuration files. This trick is not specific to Fortress, and it's not quite clear why this is not part of Ant's default behavior. The script is simple: {{{ ANTRC=./.antrc_`uname` if [ -f "$ANTRC" ] ; then . "$ANTRC" fi }}} A file name is created by concatenating {{{./.antrc_}}} with the output of uname. On the systems easily available to us, uname returns Darwin, Linux, or Solaris. If that file (for example, on a Mac, {{{.antrc_Darwin}}}) is found, then it is run, and it can in turn run other files, and set variables significant to ant. Until recently, {{{.antrc_Darwin}}}, {{{.antrc_Linux}}}, {{{.antrc_SunOS}}} contained {{{ . .antrc_Unix }}} which runs whatever is in [source:trunk/.antrc_Unix .antrc_Unix]. == Increasing the heap for Scala == Initially this was just a convenience. With the addition of Scala to our build chain, it became necessary to increase the heap size for ant. We added this to our own "./ant" script, but it is easy to forget to prepend the "./" to the command. By adding {{{ if [ -z "$ANT_OPTS" ] ; then ANT_OPTS="-Xmx256m" echo Using ANT_OPTS="\"$ANT_OPTS\"" fi }}} to [source:trunk/.antrc_Unix .antrc_Unix], it remain possible to run successfully with plain "ant". == Forcing ant to use Java 1.6 (on Macs) == As of [changeset:3373 revision 3373], Project Fortress requires Java 1.6 to build and run. The latest release of [http://gee.cs.oswego.edu/dl/concurrency-interest/ jsr166y] solves several hard problems related to work-stealing, and it requires Java 1.6. Java 1.6 is easily available on Solaris, Linux, and (most?) Intel Macs. On a Mac it is [UsingJavaOnMac recommended that you use the Java Preferences Utility] to set the default version of Java, but ant persists in running with 1.5, and will thus fail. There are several workarounds, but the one that involves the least day-to-day fuss and no use of root access, is to use the [source:trunk/antrc_suggested suggested ~/.antrc], which will then run [source:trunk/.antrc_Darwin .antrc_Darwin], which sets the appropriate environment variable force ant to use the intended version: {{{ if [ -z "$JAVACMD" ] ; then JAVACMD="`which java`" echo Using JAVACMD="\"$JAVACMD\"" fi . .antrc_Unix }}}