gradle template: ensure buildDir exists before building

bnd doesn't ensure this

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>