use proper beforeTask hook instead of task dependence (for symmetry with afterTask, each task is only built once by gradle)