api / org.gradle.api.file / CopyProcessingSpec / eachFile

eachFile

abstract fun eachFile(action: Action<in FileCopyDetails>): CopyProcessingSpec

Adds an action to be applied to each file as it is about to be copied into its destination. The action can change the destination path of the file, filter the contents of the file, or exclude the file from the result entirely. Actions are executed in the order added, and are inherited from the parent spec.

Parameters

action - The action to execute.

Return
this

abstract fun eachFile(@DelegatesTo(FileCopyDetails, 1) closure: Closure<Any>): CopyProcessingSpec

Adds an action to be applied to each file as it about to be copied into its destination. The given closure is called with a org.gradle.api.file.FileCopyDetails as its parameter. Actions are executed in the order added, and are inherited from the parent spec.

Parameters

closure - The action to execute.

Return
this