The Hidden World of Build Automation

Ammar Jivraj
Strategio
Published in
4 min readFeb 21, 2023
https://lightrun.com/top-10-build-automation-tools/

When entering the realm of software engineering the way we “build” our code and projects isn’t what first comes to mind, especially for the laymen. While it does not necessarily sit at the forefront of our minds, build tools are an integral piece of the software development lifecycle and can impact everything from the architecture of a project to the efficiency of team members. So, what is build automation anyways?

Build automation is the process of automating the tasks when we want to deploy the software we have created. These tasks include a host of frameworks, tools, and practices which are involved in compiling code, putting together different pieces of code/software, running automated tests, and packaging everything together clean and neatly for distribution or deployment. With build automation, we also experience benefits in the form of improved productivity, consistency in the way our software is built throughout a project, and much more. Now, let's take a look at some of the popular technologies used in build automation.

Gradle vs npm

https://www.jrebel.com/blog/what-is-gradle

Gradle is a front-runner in build technologies used in Java and is compatible with other languages such as Kotlin and C++. Gradle has its own ‘domain-specific language.’ As you may be able to infer, having its own language allows developers to define and customize their build process to a tee. This includes configuring custom dependencies and of course plug-ins. This knack for customizability makes Gradle a powerful choice for building large-scale software projects.

Npm on the other hand is used primarily for building and managing JavaScript projects. Npm in nature is declarative using the package.json file to declare things like project dependencies and build scripts. Because npm does not have its own DSL (domain-specific language), Gradle comes off as much more flexible and even more powerful because you are able to customize your build to a much greater extent. Of course, with this added flexibility, it also means much more responsibility is placed on the developer to configure the build while npm is quite “hands-off.” As they say, “with great power comes great responsibility.” The hands-off approach with npm gives the user a way to easily configure builds and dependencies without developers having to give as much thought and leads npm to often becoming the default choice for JavaScript developers new and old, especially for smaller projects like single page web apps. In terms of usability, npm is very user-friendly in this sense.

Let's imagine we are building (pun intended) a LEGO spaceship to wrap your head around the differences and similarities between the two technologies. Using npm would be equivalent to following the instructions from a pre-made LEGO kit. The instructions tell you exactly what pieces you need and in what order to assemble them. It’s easy to follow and you can quickly build the spaceship without much prior experience.

In contrast, using Gradle would be like building a custom LEGO spaceship without instructions. You have all the pieces you need, but you need to figure out how to put them together in the right order to make the spaceship you want. This requires a bit more creativity and skill, but you have more control over the final result and can create something truly unique.

So just like you might choose to follow instructions to build a spaceship quickly and easily, you might choose npm if you are building a small Javascript project and want something simple and straightforward. If you wanted more control and flexibility with what you are creating, you might choose Gradle which allows you to customize the build process to your specific needs.

Netflix

I would like to close this blog post with an example of a real-world use case for Gradle. Netflix pivoted well since the inception of their company and like many companies are doing today, they took the dive to become a full-on tech giant. Netflix uses Gradle to build and deploy in their microservice architecture schema. They chose Gradle specifically for, well you guessed it, flexibility and the ability to define custom logic to their build automation. The company also takes advantage of the various plug-ins available to Gradle like Docker (a popular and widely used containerization tool) as well as AWS. Netflix has been impressive in its own right, contributing to the open-source tech sphere by releasing its own plugins for Gradle making it easier for developers to build/deploy in a microservice-oriented architecture. Netflix is a perfect instance of utilizing a build tool like Gradle while taking advantage of its flexibility in a large-scale software environment.

Writing this article was great in helping me understand the state and use of build automation tools and I hope all of you readers can say the same. If you would like more content like this and to hear my ramblings, make sure to follow my page. Thanks for reading and see you all next time!

--

--