Today we are lucky enough to have a guest blogger! Himanshu Chhetri is a developer at Addteq and works with the Configuration Management and Atlassian Solutions delivery teams. In his free time he likes to keep up-to date with the latest open source projects and the devops movement.
Most developers use Eclipse as their IDE of choice for Android development. Google provides the ADT (Android Developer Tools) plugin for Eclipse that simplifies the process of setting up new Android projects and going about development.
However, when setting up Continuous Integration for Android projects, we would need to build outside the IDE. The Android SDK is bundled with various command line tools to help us build Android projects. Ant is one tool which lets us compile and build the project into an installable .apk file.
The process of building Android apps using Ant is best illustrated by the description in the official documentation:
There are two ways to build your application using the Ant build script: one for testing/debugging your application — debug mode — and one for building your final package for release — release mode. Regardless of which way you build your application, it must be signed before it can install on an emulator or device—with a debug key when building in debug mode and with your own private key when building in release mode.
When it comes to Continuous Integration tools we prefer to use Atlassian Bamboo because it goes beyond build automation and has amazing features ranging from numerous built-in and third party tasks to seamless integration with Atlassian Jira allowing users to assign issues right from the build result page. Also, Addteq is an Atlassian partner and we practice what we preach when it comes to developer tools!
For an Android project that we are working on, we wanted to setup Bamboo to provide the developers rapid feedback about any changes happening in the project. With Android SDK’s built-in support for Ant and Bamboo’s ease of use, we were able to quickly setup a build pipeline by following the anatomy of a typical Bamboo build.
We have a build stage that consists of tasks to get the latest changes to the project’s Git repository (Which is managed using Atlassian Stash but we will save the details for a future blog post!), execute the Ant script via the Bamboo Ant task to compile the source code and create the APK package as well as generate the API documentation in HTML using Javadoc. To generate the javadoc we added a target to the build script and utilized Ant’s javadoc task. The build script also copies the generated javadocs to Apache web server’s default Document Root so that developers can access it from http://bamboo-host/javadocs
We have a second stage that runs various kinds of static code analysis tools for Java: Checkstyle and PMD.
Bamboo also allows for sending of immediate feedback of the build results via email notifications to developers. Another useful feature is assigning responsibility for build failures. Also, if you are using Stash you have the option to view Bamboo build results for a commit or pull request which is very useful.
Want to know more?
At Addteq we are official experts in Atlassian tools and highly competent in the arena of software configuration management. We’d love to help you answer any questions you may have. You can learn more about who are and what we do by visiting us at www.addteq.com.