gradle: do not fork unless needed, fix srcDirs, delay run dependencies resolving

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>