I am trying to set some global configurations for common tasks like Copy. While tasks.withType works for any tasks of type Copy, configurations are not getting applied with copy closure inside a general task.
This is by design. The withType method works only on Task types (Class level). By just using the copy method within a default task, the type of the task is still DefaultTask. That’s why this task is not picked up by tasks.withType(Copy)
Copy preserves the original file permissions which are generally read only as set by scm. Many times we want to override/overwrite files during incremental builds. I was wondering if I can somehow set rw file mode globally and not individually everywhere.