异步gradle复制任务? [英] Asynchronous gradle copy task?
本文介绍了异步gradle复制任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
import java.util.concurrent。*
...
def es = Executors.newSingleThreadExecutor()
...
war {
...
doLast {
es.submit( {
复制{
from destinationDir.absolutePath + File.separator +$ archiveName
到destinationDir
重命名为$ {archiveName},$ {baseName}。$ {扩展}
}
}作为可调用)
}
}
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 {
...
doLast{
es.submit({
copy {
from destinationDir.absolutePath + File.separator + "$archiveName"
into destinationDir
rename "${archiveName}", "${baseName}.${extension}"
}
} as Callable)
}
}
这篇关于异步gradle复制任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文