Installing Apache Ant
Installing Ant can be a bit annoying if you do not have a package manager (e.g. Apt, Yum, Homebrew, etc.). This guide aims to walk you through the setup process.
#A Few Quick Notes
- This guide does not require sudo (assuming you already have
wget
installed. That requires sudo). - This guide assumes you are comfortable with the following commands:
- None, actually - this guide is really short.
- This guide uses the following programs:
- A modern shell (The thing that Terminal uses)
-
wget
* If you do not have it,sudo apt-get install wget
orsudo yum install wget
should do the trick. - That's it
- Ant will be installed in a folder called
.ant
in your home directory.
Usels -lh $HOME/.ant
to see what is in it.
#Walkthrough
-
Run:
bash <(wget -qO - https://raw.githubusercontent.com/Toberumono/Miscellaneous/master/ant/automatic_install.sh)
-
Restart Terminal
-
All done!
#Excessive Detail This section contains extra details that aren't important to the Walkthrough, or, well, any part of this page, really, but might be interesting at some level.
##So, what does the only command in this whole thing do?
- Uses a pattern in the Ant release notes to grab the most recent version number
- Determines whether the current version of Ant (if it exists) needs to be updated
- If it does not, it prints a message to that effect and then exits.
- Downloads the tarball for the newest version and unpacks it into a versioned subfolder in the
.ant
directory. - Updates the
~/.ant/current
symlink - Calls
append_paths.sh
to append the appropriate paths to the user's bash profile.
##Okay, what does the append_paths.sh
script do?
This script just adds the necessary export commands the user's appropriate shell profile file.
Specifically, it adds:
- export PATH="$HOME/.ant/current/bin:$PATH"
It detects the correct profile file and adds the paths using the get_profile.sh
and update_rc.sh
scripts in the common section of this repository. You can see more information on them here: https://github.com/Toberumono/Miscellaneous/tree/master/common