Ninja – A small build system with a focus on speed
martine.github.io
martine.github.io
For those of us without XML phobia, it doesn't offer any benefit and is slow as molasses.
The benefit wrt the old Ant-based build is the way it lets you specify 3rd party dependencies. Being able to just add in say Timber, ButterKnife and Guava with a few lines of config, rather than downloading the jars, faffing with paths, making sure the pre-processing bits are in place, etc, is really a big benefit. Maybe Maven would have been a more sensible choice, since Gradle/Groovy seems pretty niche and not really used that much outside Android.
This is the only reason I am now forced to deal with it.
On our enterprise Java projects it is all about Ant and Maven.
http://neugierig.org/software/chromium/notes/2011/02/ninja.h...
I've used ninja only during my experiments with chromium and I found it blazing fast.
...but you categorically cannot argue that Kitware has single handed transformed the entire C++ build infrastructure landscape; the brand new cross platform IDE by JetBrains (CLion) uses cmake as their primary build method.
You have to tip your hat to the fact that KitWare been fantastically successful in their mission.
Like it or not, it's a fact. Cmake is here to stay.
Make could have been a contender, but the only people who cared enough about it to actually build anything useful with it, built automake; which is a piece of stinking rubbish, not portable, and has a syntax even more arcane than make OR cmake.
Maybe if android and the google make toolchain had arrived 4 years earlier, we'd be somewhere else now, but the gate is closed now. Make is obsolete as a build system for a modern project that has to, you know, actually compile on multiple targets.
They manage to keep up with all the churn in the world of compiled software, whereas it would be so easy to let a tool like CMake bitrot. Old mistakes have sensible deprecation policies too, so they have managed to avoid the accumulation of cruft that could have brought it to a standstill.
e.g Make/CMake decides whether you're doing a debug or release build, and builds the appropriate ninja files. Ninja then doesn't have any decisions to make, other than purely what to build, which makes it fast.
It's used for Chrome/Chromium, and I believe the "no-op" build time is still under a second. If you then change a .cpp, it will only compile the absolute minimum, and calculation as to what to build is incredibly fast. make is considerably slower on the same set of files (so they say, not tested it personally, but the figures are around somewhere).
Probably only worth it for really big projects.
(And yes, part of the reason Ninja succeeded is because it ties the hands of the person generating the files. Make gives people enough rope to hang themselves and they frequently do. From the manual: "To restate, Ninja is faster than other build systems because it is painfully simple. You must tell Ninja exactly what to do when you create your project’s .ninja files.")
[edit: typos]
I wasn't able to do a direct comparison of the build speeds of the two systems, but I bet the Ninja builds were significantly faster.
Makefiles I presume, will be hard to write by hand when:
1. Your project code base is large 2. It take large amount of time or very powerful machines to build sub-modules (V8 for e.g in chromium) so, you don't want to do it all the time 3. Conditional inclusion of sub-modules (for iOS vs Android if you have two separate set of files etc) 4. Sub-modules are pulled in from 3rd parties into your code base