There is not even a "Gradle" way to have a project-temporary directory, only the task-temporary directories, which are not actually temporary directories either, as they are not cleared up ever except if you do it yourself.
I was told by Gradle guys to just use the normal Java facilities to create temporary directories.