user447607 user447607 - 8 months ago 94
Groovy Question

Asynchronous gradle copy task?

So I create an archive, say a war, and then I want another copy with a different name for convenience. Thing is that I don't want that copy task to slow down the rest of this rather large build. Possible to execute it asynchronously? If so, how?

import java.util.concurrent.*
def es = Executors.newSingleThreadExecutor()
war {
            copy {
                from destinationDir.absolutePath + File.separator + "$archiveName"
                into destinationDir
                rename "${archiveName}", "${baseName}.${extension}"

        } as Callable)