Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up TeamCity to build Android Studio project

I cannot for the life of me find any reference on the internet for how to setup TeamCity to build Android Studio projects.

I've found links to IntelliJ Idea and TeamCity, to Gradle and TeamCity, but nothing specifically on building an Android Studio project in TeamCity.

Can anyone point me in the right direction?

like image 672
Dr. Andrew Burnett-Thompson Avatar asked Mar 03 '15 18:03

Dr. Andrew Burnett-Thompson


People also ask

How do I set up a build in TeamCity?

Go to Administration | Projects and open the required project. Alternatively, open the project using the Projects pop-up menu and click Edit Project Settings. The Project Settings page will open. On the Project Settings page, click Create build configuration under the Build Configurations section.

How do I use custom build in TeamCity?

To run a custom build with specific changes, open the build results page, go to the Changes tab, expand the required change, click the Run build with this change, and proceed with the options in the Run Custom Build dialog. Use HTTP request or REST API request to TeamCity to trigger a build.


1 Answers

Thanks to Yole's direction, I've set this up now.

The steps if anyone is interested are below:

  1. Install Gradle on the build agent server. I took the gradle-2.3.bin from http://gradle.org/downloads and copied to C:\gradle-2.3
  2. Set the environment variable GRADLE_HOME = C:\gradle-2.3
  3. Install Android Studio on the build agent server. This should also install the Android SDK
  4. Set the environment variable ANDROID_HOME = C:\Users\%Current User%\AppData\Local\Android\sdk
  5. Restart the TeamCity agent server
  6. Setup your build configuration with the Gradle runner, setting Gradle tasks to 'clean build' and setting the Gradle Home path. Set working directory to the project directory for your Android project

Run the build!

enter image description here

like image 56
Dr. Andrew Burnett-Thompson Avatar answered Sep 18 '22 02:09

Dr. Andrew Burnett-Thompson