After research, this seems to be caused by incorrect placement of “apply … thorntail.gradle”.
Adding apply to buildscript and using ‘to buildscript’, seems to work for me:
buildscript {
apply {
from ‘thorntail.gradle’
to buildscript
}
}
I found these in kotlin-dsl Github repository, where I found (an issue and a pull request related to applying a script to buildscript.