Square Jul 27, 2023

Supercharging Continuous Integration with Gradle

Article Summary

Paul Hundal and Pablo Baxter from Square reveal how they slashed CI analysis time by 80% on a monorepo with 5,000+ modules. Their secret? Getting creative with Gradle's internals.

Square's Android team runs 1,200 CI shards over 200 times daily, with builds averaging 65 minutes. As their codebase exploded from 3,500 to 5,000+ modules, they needed radical optimization. This deep dive shows how they combined shard avoidance, Gradle Tooling API, and custom caching to transform their pipeline.

Key Takeaways

Critical Insight

Square reduced their CI avoidance analysis from 11 minutes to 2 minutes by building custom tooling around Gradle's Tooling API and implementing intelligent caching across all repository branches.

They're now exploring Configuration Cache integration that could eliminate nearly the entire 10 minute analysis cost, bringing it close to zero.

Recent from Square

Related Articles