Copy task is up-to-date, but slow determining it is up-to-date

This is question is somewhat related to the ‘best practices for managing javascript’.

When I unzip an artifact that contains my javascript dependencies, the task is marked up-to-date when nothing has changed (which is correct), but it is slow if the dependent artifacts are large. It there an alternative that is faster?

dependencies { javascript

‘com.company:jsmodule1-1mb:1.0’,

‘com.company:jsmodule2-1mb:1.0’,

‘com.company:jsmodule3-40mb:1.0’, }

task javaScriptDependencies(type:Copy, group: ‘Grunt’) {

from {

configurations.javascript.collect { zipTree(it) }

}

into webStaticDependenciesDirectory

doFirst { delete webStaticDependenciesDirectory } }

can you provide some numbers here? I noticed myself that for really huge directories (>10000 files) the up-to-date check takes a noticable amount of time. Using a network drive can slow down these checks even more.

Taken from gradlew --profile prj:web 22.500s (total)

:prj:web:javaScriptDependencies 21.641s UP-TO-DATE

:prj:web:compileJavaScript 0.852s UP-TO-DATE

:prj:web:gruntInstall 0.005s UP-TO-DATE

:prj:web:gruntWrapper 0.002s UP-TO-DATE

There are 2 zip archives from Artifactory: 1. 45.6 MB / 4,097 Files, 197 Folders 2. 1.51 MB / 25 Files, 2 Folders

My expectation was that 20 seconds was slow and maybe there was another approach. Is is possible to only execute the task if the dependency changed and just assume the files were extracted? Just looking for another idea.

+1 for this. A good chunk of my total build time is spent checking if an up-to-date Sync is actually up-to-date.

It’d be great if there was

upToDateStrategy = {'strict', 'existsIsGoodEnough'}'