Ok let’s compare Rake with some other build tools:

There are a number of awesome other build tools out there and I think it’s important to see how they approach the same problem differently.

Who knows maybe we decide to use something other than rake for our next project!

For that reason, I’ve picked a couple of tools and picked an objective to try them out:

Apache Ant: Is an XML-based build tool and very popular in java world. There is no code, it’s all XML!

Gulp: Is a popular build tool in JavaScript world and it has an awesome concept called pipes which we’ll see in a minute.

Objective

Say we have these three JS files in our `source` folder:

We’d like to concatenate and minify them and then run the minified version using node to make sure it works!

Just to throw in some complexity, we’d also like to name our final file after the owner of the machine that is running the build (in my case the end result should be `rudy.min.js`).

This is how it should look like:

You can access this project on GitHub if you want to play around with it.

Rake

This is how rake would do it:

As you can see the final file is being generated in two steps, first the source files are concatenated into `rudy.src.js` and then this file is minified into `rudy.min.js`. (We can do it in one step if we want by passing `out` in line 17 into `compile` in line 30)

Ant

As you can see `target` in Ant is equivalent to `task` in Rake.

I couldn’t find a way to do the concat and uglify in a single step, if you know how to do it please leave a comment. 🤓

Gulp

The pipe concept allows you to stick processes together to form a pipeline.