# Herding Elephants

DevFeed: [Herding Elephants](<https://devfeed.tech/articles/herding-elephants-15673.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/herding-elephants>)

Author: Tony Robalik

Published: 2021-11-04T11:00:00Z

Content type: article

Language: en

Sources: [Square Corner](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [gradle-plugin](<https://devfeed.tech/topics/gradle-plugin.md>), [composite-build](<https://devfeed.tech/topics/composite-build.md>), [experience report](<https://devfeed.tech/topics/experience-report.md>), [Code Modularity](<https://devfeed.tech/topics/code-modularity.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Android Gradle Plugin](<https://devfeed.tech/topics/android-gradle-plugin.md>), [Boilerplate](<https://devfeed.tech/topics/boilerplate.md>), [Dependency management](<https://devfeed.tech/topics/dependency-management.md>), [Tech Debt](<https://devfeed.tech/topics/tech-debt.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [Android Library](<https://devfeed.tech/topics/android-library.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-gradle-plugin](<https://devfeed.tech/tags/android-gradle-plugin.md>), [android-library](<https://devfeed.tech/tags/android-library.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [apis](<https://devfeed.tech/tags/apis.md>), [app](<https://devfeed.tech/tags/app.md>), [applications](<https://devfeed.tech/tags/applications.md>), [apps](<https://devfeed.tech/tags/apps.md>), [artifactory](<https://devfeed.tech/tags/artifactory.md>), [ast](<https://devfeed.tech/tags/ast.md>), [bash](<https://devfeed.tech/tags/bash.md>), [bazel](<https://devfeed.tech/tags/bazel.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [block](<https://devfeed.tech/tags/block.md>), [blocks](<https://devfeed.tech/tags/blocks.md>), [boilerplate](<https://devfeed.tech/tags/boilerplate.md>), [build](<https://devfeed.tech/tags/build.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [module](<https://devfeed.tech/tags/module.md>), [project](<https://devfeed.tech/tags/project.md>)

## AI overview

Square's MDXA team reorganized build logic across a 3,500-plus-module Gradle repository around convention plugins that encode the company's module model. Module scripts were reduced to concise plugin, dependency, and optional configuration declarations; common settings moved into tested plugins. The team added unit and Gradle TestKit integration tests, including a Gradle and Android Gradle Plugin version matrix. Moving logic from buildSrc to an included build avoided buildSrc's per-build checks and broad configuration invalidation, but plugin resolution from the included build added about 30 seconds (roughly 33%) to configuration. Publishing binary plugins to Artifactory removed that regression for feature engineers, while retaining the included build for rapid prototyping. The migration also used an AST-based tool to rewrite scripts. The article reports lower script complexity, reduced memory pressure, and faster builds, while acknowledging that complexity was relocated into a separate, tested build domain.

## Source excerpt

Wrangling a 3,500-module Gradle project