Closed Vampire closed 6 years ago
So to understand correctly. Each task should create one temp directory called temporaryDir
?
And tanks again. It was not my intention to rely only on deleteOnExit
. I thought I added a second delete logic ... Your proposal makes perfect sense.
Oh, maybe i missed the second delete logic, I just skimmed over your code and the others that are similar to quickly evaluate which I try first. :-)
Each task automatically has a temporary directory assigned by Gradle.
They are in $buildDir/tmp/${task.name}
.
They are not created if you don't use them.
But you can easily use them by using the getTemporaryDir()
method and thus the temporaryDir
property of the DefaultTask
.
Ah cool thanks. Didn't know that. Then it makes total sense to use this instead because clean
will cover it without further configuration.
Exactly my point. :-)
https://github.com/wooga/atlas-github/blob/72012b690cda7cb359f37969053458c8d9947b26/src/main/groovy/wooga/gradle/github/publish/tasks/GithubPublish.groovy#L80-L83
is maybe not the best idea. Depending on
deleteOnExit
can easily lead to stale files if the daemon VM crashes or is killed and each task has a designated temporary directory. So maybe it would be better to useAnd then
project.sync
instead ofproject.copy
for filling theassetCollectDirectory
and deleting theassetUploadDirectory
before copying over the files thereto, letting theclean
task delete the directory as usual. This also allows to better look for problems, if the files are not deleted automatically after the VM shuts down.