I have a task
that performs a couple of clean
and copy
tasks on Windows 8.1:
copyDestinations.each
{ destination ->
def cleanTaskName = "clean_$destination.name"
def copyTaskName = "copy_$destination.name"
task(cleanTaskName, type: Delete) {
delete destination.location
}
task(copyTaskName, type: Copy) {
dependsOn(cleanTaskName)
from project.gradle.gradleUserHomeDir.getCanonicalPath() + '/../Artifact Dependencies'
from configurations.talendLibs
from fileTree('Executables/Conversion/ArtifactDependencies/')
into destination.location
}
talendDependencies.dependsOn(copyTaskName)
}
When calling this task from a batch file with the daemon enabled, the daemon initializes and the task runs successfully, but the process doesn’t exit. This behavior is the same whether I’m running gradle
2.11, 2.14, or 3.0-m1, by way of the wrapper. Presumably it is waiting on the daemon and would exit in 3 hours when the daemon times out, because killing the process kills the daemon as well. This makes it impossible to use the task when scripting without using the --no-daemon
flag because the script hangs waiting for that child.
Is this just a fundamental limitation on Windows, that you can’t really daemonize the way you can on Unix? If so this should be part of the documentation.