-
Notifications
You must be signed in to change notification settings - Fork 6
Initializing a Build Environment
This app is built using Apache Maven. Maven will automate the process of compiling and assembling the apklib, jars, and apks, as well as run automated tests.
In general, the complete setup required for compilation requires the following steps:
- Set up the JDK
- Set up the Android SDK
- Set up Maven
If the JDK is not already installed on your computer, grab it from http://www.oracle.com/technetwork/java/javase/downloads/index.html and follow the instructions. Add a variable from JAVA_HOME on your system. The install location is different on every platform, so do a search for "java home [platform]" with your platform.
Download the latest version of the Android ADT bundle - https://developer.android.com/sdk/index.html. Note that the ADT bundle isn't needed, just the SDK Tools (under use an existing IDE) will be fine, since we will be using IntelliJ anyways. The procedure (and commands) will be same either way. Unpack the jar file to your home folder, and rename the folder to android-sdk (any other location is fine as well, but the the commands I'll show will assume the home directory as the location).
- On Linux/Mac, run the following commands
export ANDROID_HOME=~/android-sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
- On Windows Add a user variable $ANDROID_HOME to the location of your SDK Append your path with $ANDROID_HOME/tools;$ANDROID_HOME/platform-tools I've had issues with using variables on my PATH, so if needed, set the full path to your SDK in your PATH as well (the downside to this is if you change the location of the SDK, you have to now change it in three places, $ANDROID_HOME, and twice in your path).
For Linux systems, simply use your package manager to install 'mvn'. On Ubuntu, the command would be
sudo apt-get install mvn
On Macs, first install HomeBrew , and then run
brew install maven
You can manually install by getting the binaries from Apache Maven, but it ends up being more cumbersome.
For Windows, there is an excellent guide available.