-
Notifications
You must be signed in to change notification settings - Fork 6
Initializing a Build Environment
UPDATE - I found a comprehensive guide if you want to learn more about the maven build process.
The build requires Maven
v3.0.3+ and the Android SDK
to be installed in your development environment. In addition you'll need to set
the ANDROID_HOME
environment variable to the location of your SDK. Maven will automate the process of compiling and assembling the apklib, jars, and apks, as well as run automated tests.
NOTE: Maven is NOT required to build this application. You can impor the project in eclipse and add its dependencies as library projects and/or jars.
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 for more instructions.
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).
- UNIX; run the following commands
export ANDROID_HOME=~/android-sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
- Windows
- Add a user variable $ANDROID_HOME to the location of your SDK
- Append your path with
$ANDROID_HOME/tools;$ANDROID_HOME/platform-tools
- Windows - http://www.mkyong.com/maven/how-to-install-maven-in-windows/
- Ubuntu - http://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/
- Mac - http://www.mkyong.com/maven/install-maven-on-mac-osx/
- Run
mvn clean package
from theapp
directory to build the APK only - Run
mvn clean install
from the root directory to build the app and also run the integration tests, this requires a connected Android device or running emulator