FAILURE: Build failed with an exception.
* Where:
Build file 'parent\build.gradle' line: 4
* What went wrong:
A problem occurred evaluating project ':foo'.
> Could not find method setProjectVersion() for arguments [1.3] on project ':foo'.
Perfect! I had moved it out of allprojects because I started out defining a function, and that is apparently not allowed inside the allprojects block (Groovy noob here). However, this seems to do exactly what I want, thanks!
No problem. I sort of think of the scripts as separate classes (so methods defined in there are local only to that ‘class’). I think allprojects {} might get turned into its own class too through an AST transform.
If there’s anything I want to carry around, I attach it to something that is more permanent (project, task, etc).