Why eachFile on a filtered FileTree still seem to run on all files

I’d separate the unzipping into its own task which can be skipped if it’s up to date. Eg:

task unzip {
   inputs.files configurations.frontEnd
   outputs.dir "$buildDir/unzip" 
   doLast {
      def zips = configurations.frontEnd.findAll {
         it.name.endsWith("user-login-ui.zip") 
      } 
      copy {
         from zips.collect { zipTree(it) } 
         into "$buildDir/unzip/public" 
         include 'user-login/**'
         include 'user-login-ui/**'
     } 
  } 
} 
bootJar {
   from unzip 
} 

See also Feature request: UnzipTask

1 Like