
Ninja – A small build system with a focus on speed - soundsop
https://martine.github.io/ninja/
======
sanxiyn
Ninja is a carefully tuned system that befits the name "software engineering".
I highly recommend reading Ninja chapter of the book The Performance of Open
Source Applications.

[http://aosabook.org/en/posa/ninja.html](http://aosabook.org/en/posa/ninja.html)

------
wonsler
I've used ninja and gyp for building Android apps. It is 1 to 2 orders of
magnitude faster than Gradle.

~~~
moonbug
About all that can be said for Gradle is that it makes Maven seem tolerable.

~~~
pjmlp
I don't really get the hype about Gradle.

For those of us without XML phobia, it doesn't offer any benefit and is slow
as molasses.

~~~
rquirk
You can speed it up somewhat by tweaking ~/.gradle/gradle.properties and
adding org.gradle.daemon=true and org.gradle.parallel=true. That way at least
it doesn't have to re-read all the build files each time and will run some
parts in parallel.

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.

~~~
pjmlp
> ... 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.

------
praveenster
Here is the blog post about it from the author. It goes into the motivations
behind building it and the fact that it was fun project over the weekend

[http://neugierig.org/software/chromium/notes/2011/02/ninja.h...](http://neugierig.org/software/chromium/notes/2011/02/ninja.html)

I've used ninja only during my experiments with chromium and I found it
blazing fast.

------
joelthelion
I use ninja everyday with cmake and it's just perfect - never had a problem
with it.

------
IshKebab
If this is designed for generated build files, why isn't it a library? It
seems to use files as a shit IPC.

~~~
lukaslalinsky
Using files as an API is one of the most generic interfaces you can get. You
can use it from any system/language you can imagine, assuming it can write to
a file.

------
moonbug
Jeez, can't you kids just quit this square-wheel churn and just buckle down
and learn to write makefiles? It's really not that hard.

~~~
dima55
Sigh. As far as I can tell ninja is primarily used as a cmake backend. Mostly
because the people who wrote cmake never learned to write Makefiles and as a
result using ninja with cmake is much faster.

~~~
moonbug
Kitware have a lot to apologise for.

~~~
shadowmint
A lot of people don't like cmake.

...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.

------
jbergens
I still think build systems should be written in node and js from now on. Node
is easy to install on most environments, in my experience it is much easier
than python or ruby and javascript knowledge is spreading.

~~~
pjscott
You can generate .ninja files using code in any language you like, including
Javascript. Do you have a use case that this doesn't satisfy?

