Building Knowledge on Build Automation
Build Automation is utilized by many large and small enterprises daily. Aem defined Build Automation as “the process of scripting and automating the retrieval of software code from a repository, compiling it into a binary artifact, executing automated functional tests, and publishing it into a shared and centralized repository.” Some of the main advantages for organizations in utilizing build automation are that leads them to save money and time by increasing productivity, bridging the gap in time for uncovering and resolving any issues, and the maintenance of detailed records of all possible issues.
Gradle
Gradle documentation defined Gradle as “an open-source build automation tool focused on flexibility and performance. Gradle build scripts are written using a Groovy or Kotlin DSL.”
Using Gradle can be tricky but to give you a quick overview of how to use it we can look at:
Gradle Installation
- Check if Java is installed
java -version
- Download Gradle
- Set Environment Variable
- Verify Gradle Installation
Gradle Build Lifecycle
Cash App + Gradle
Cash App is a mobile payment service available in the United States and the United Kingdom that allows users to transfer money to one another using a mobile phone app. In 2021, John Rodriguez from Cash App and Rooz Mohazzabi from Gradle did a presentation at droidcon Americas highlighting a journey in Andriod Productivity with Gradle with Cash App. Some of the main points they hit in this presentation include:
How Cash App does Builds
The team worked on making the Cash App build as efficient as possible so that the developers could be more productive by being proactive. Internally they use Kochiku but they also used BuildScans which is a free service that Gradle Enterprise provides to let you see everything that is happening in the build process. Gradle Enterprise is also used through the paid service to measure and visualize build times, and how things are improving or not with optimizations made. Build Comparison is also used to compare Build Scans and see how they are changing.
Biggest wins and findings debugging Cash App local and CI builds
Comparing the BuildScans is the main drawing feature that Cash App has benefited from. They also found negative savings from the remote cache, after optimization and application of the cash fix plugin in most instances negative savings were eliminated, some wire plugin cache-ability issues, the configuration for enabling the remote cache wasn’t working correctly and unnecessary VPN issues causing long build times. However, once they identified and fixed the cache misses that had occurred, avoidance saving from the remote cash started to increase.
Best performance practices for builds at scale
- AssembleDebug Build Time Down by approximately 50%.
- Remote Cache Saving CI Builds an average of around 8 min per build.
- CI Comput Resource Saving from remote cache is around 55 days & 16 hours per week.
For more on this presentation: Click Here
I hope this was helpful in a baseline understanding of Build Automation for beginners like myself. Follow my account to get more updates on my journey in tech. Thank you for reading!