DEV Community

Discussion on: Explain Build Tools like I'm Five

Collapse
 
cjbrooks12 profile image
Casey Brooks

When developing a project, there are many things that need to be, files to be processed, archives to be packaged, etc. It is fairly straightforward to just put all these tasks into a shell script, which will do exactly what you want it to do.

But as your project grows in size, you'll find that you need to add more and more steps to your shell script. Each step is taking longer and longer (because there are more source files to process), and there are more steps, and soon your build process, written as a simple shell script, is no longer so simple or fast as it once was.

But you notice that there are certain tasks that don't depend on one another, and you can run them in parallel,which saves you time. In addition, there are a lot of tasks that don't need to be run every time, because nothing has changed and you know the output will be the same,so you can skip the next time you run your script.

All these build tools, Gradle, Maven, Gulp, Webpack, or anything else, all exist to solve those problems for you. They typically provide a flexible framework for creating tasks and plugins, and a declarative way to set up which tasks to run and in which order to run them. A good, mature build tool like Gradle will also track which files have or have not changed since the last run, to avoid repeating work (it can even cache outputs built on different servers, really tricky stuff needed for truly massive projects). Some tools, like Webpack, will even process the files very differently depending on whether you are building for development or production, to speed up iterative development time.