Ant bash completion on Mac OS X

bash will do tab-completion for ant targets on Debian/Ubuntu boxes out-of-the-box. If you haven’t upgraded lately, you may need to:

sudo apt-get install bash-completion

On Mac OS X, it needs a bit of massaging. First install the macports version of bash-completion and ant:

sudo port install bash-completion apache-ant

Then add this to the end of your ~/.bashrc:

if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
complete -C /opt/local/share/java/apache-ant/bin/complete-ant-cmd.pl ant

See http://marius.scurtescu.com/2005/03/23/ant_bash_completion for Windows instructions.

Related posts:

  1. Apache2, PHP, and MySQL on Mac OS X using MacPorts
    1. Install MacPorts Follow the instructions here: http://www.macports.org/install.php. 2. Install apache2 sudo port install apache2 Note that the macports instructions suggest installing the launchctl script now, but we’ll do that......
  2. Installing git with MacPorts
    The Good: MacPorts makes git, the new source version control system hotness, available to Mac users. The Bad: MacPorts sometimes has attitude, and poops out trying to compile or install......
  3. How to set up native subversion (javahl) with Subclipse on Mac OS X
    Note that this is for Ganymede (Eclipse 3.4.x). Install the javahl binding with MacPorts: sudo port install subversion +bash_completion sudo port install subversion-javahlbindings Run eclipse, and add this upgrade site:......
  4. How to increase maven heapspace in hudson builds
    If your maven-built project fails in hudson (especially when you’re using the assembly plugin) and it isn’t a compile or test failure, check the console output. If it says “java.lang.OutOfMemoryError:......

This entry was posted in Technical HOWTOs and tagged , , , . Bookmark the permalink.

One Response to Ant bash completion on Mac OS X

  1. ant is built in if you installed the Apple dev tools:

    sudo port install bash-completion
    
    if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
    fi
    complete -C /usr/share/ant/bin/complete-ant-cmd.pl ant
    

    for the build int command.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Additional comments powered by BackType