Conditional Gradle Configuration by Build Variant

Leverage the advantages of Groovy to conditionally include and exclude entire Gradle plugins based on your build type, and keep your build times low.

Conditional Gradle Configuration by Build Variant

Gradle is a powerful build tool that reigns as the dominant choice among Android developers. Despite its popularity, the complexity of fine-tuned optimizations can sometimes baffle newer engineers.

One circumstance had me and my team at UPMC Enterprises scratching our heads for weeks. We needed to conditionally include or exclude entire plugins and their associated configurations from our build based on the selected type or product flavor.