But then I cloned a clean copy of the repo, and the build fails because at configuration phase ${buildDir} hasn’t been created yet. How can the “new” be delayed until execution phase? (Note that commandLine is required at configuration, so you can’t just “<<” it)
Thank you, @Lance_Java - that does solve the problem in my actual project…
But it isn’t quite a complete solution to this toy build. In my real project the Exec task dependsOn a task which ensures ${buildDir} exists. This toy build we have been using to describe the problem needs to
mkdir "${buildDir}"
just prior to the “new” to work (fortunately mkdir is a no-op if the dir already exists).