# How Microsoft Teams Android reduced build time with telemetry and Gradle upgrades

DevFeed: [How Microsoft Teams Android reduced build time with telemetry and Gradle upgrades](<https://devfeed.tech/articles/ammunition-in-the-war-against-teams-android-build-time-22779.md>)

Original publisher: [Read original article](<https://medium.com/microsoft-mobile-engineering/ammunition-in-the-war-against-teams-android-build-time-2736a9c280ad?source=rss----87f10537e947---4>)

Author: Saumye Srivastava

Published: 2023-05-03T10:08:11Z

Content type: article

Language: en

Sources: [Android@Microsoft - Medium](<https://devfeed.tech/sources/android-microsoft-medium.md>)

Topics: [build performance](<https://devfeed.tech/topics/build-performance.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Android](<https://devfeed.tech/topics/android.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>), [ci](<https://devfeed.tech/topics/ci.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [build](<https://devfeed.tech/tags/build.md>), [ci](<https://devfeed.tech/tags/ci.md>), [developer-productivity](<https://devfeed.tech/tags/developer-productivity.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [modules](<https://devfeed.tech/tags/modules.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [performance](<https://devfeed.tech/tags/performance.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [telemetry](<https://devfeed.tech/tags/telemetry.md>)

## AI overview

This article describes Microsoft Teams Android's efforts to improve build performance in a codebase with more than 300 modules. The team collected Gradle task telemetry across developer environments and reported a 30-40% build-time improvement after Gradle upgrades.

## Source excerpt

The mobile industry is an ever-evolving space, with new innovations and updates being introduced regularly. This means that the competition is fierce, and every day counts in shipping features and bug fixes. The time it takes to build an Android app is a crucial factor that impacts developer productivity, which in turn can affect the app's success. The percentage reduction in build time leads to percentage increase in shipping features and bug fixes. At Microsoft Teams Android, we understand this well and have been working relentlessly to improve our Android build time over the past quarter. Photo by Venti Views on Unsplash Our Android codebase comprises of 300+ modules that are contributed by hundreds of developers who run thousands of builds per day, both locally and in our Continuous Integration (CI) and Pull Request (PR) triggered pipelines. 1. Build Telemetry We aimed to start by setting a baseline for our build configuration and execution time on both the project and task levels. To do so, we collected telemetry from all developers in different environments and machines. We started with setting up build telemetry for each gradle task. For this we used TaskExecutionAdapter and BuildListener that sent build telemetry to our monitoring servers by listening via the Gradle.addListener API. Along with the gradle task execution time, we also sent device and development details, branch creation dates, cores, RAM, OS, and the list of modules changed. Shortened output format, {'Build_Time': 82, 'deviceId': '<>', 'modelName': 'MacBook Pro', 'modelIdentifier': 'MacBookPro18,2', 'processorName': 'Apple M1 Max', 'totalCores': '10 (8 performance and 2 efficiency)', 'memory': '32 GB', 'timezone': '+0530', 'task': 'preparekotlinbuildscriptmodel', 'taskData': '{}', 'os': 'Darwin', 'cleanBuild': False, 'totalTaskTime': 0, 'versionName': '1416/1.0.0.2023060799', 'modulesChanged': '["apps/teams", "common/beacon"]'} This helped us collect data and build monitoring on a daily basis