TeamCity

Unlike Jenkins, TeamCity is a proprietary product that is free to use only for open source projects. It is created and managed by JetBrains. This is the same company that also created IntelliJ IDEA, which is the IDE that Android Studio is based on. TeamCity supports Android builds with Gradle out of the box.

Setting up TeamCity

If you do not have a running TeamCity installation yet, download it from the JetBrains website (https://www.jetbrains.com/teamcity) and follow the steps.

To get started with building Android apps and libraries with TeamCity, you need to make sure the JDK, the Android SDK, and the Android build tools are installed on your build server. You can find the instructions for this in the Jenkins section. You also need to add ANDROID_HOME to the environment variables of the machine, and point it to the Android SDK directory.

Unlike Jenkins, TeamCity does not require any plugins to trigger Gradle builds, as TeamCity has built-in support for running Gradle.

Configuring the build

To set up an Android build, you start by creating a new project. All you need to provide is a name. Once the project is created, you can start configuring it. First, you need to add a VCS root so that TeamCity can find the source code for your project. Then you need to create a new build configuration. You also need to attach the VCS root to the build configuration. When that is set up, you can add a new build step. If you press the Auto-detect build steps button, TeamCity will try to determine the necessary build steps, based on the content of the project. In case of a Gradle-based Android project, the result looks like this:

Configuring the build

TeamCity detects that the project uses Gradle, and even that the Gradle wrapper is present. You can just select the Gradle build step, and add it to the build configuration. If you do not need to do anything advanced, this is enough to make sure your Android app gets built. You can test the configuration by opening the project overview and clicking on the Run… button for the Android project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset