Excluding empty directories from SourceSets

Can I exclude empty directories from SourceSets, similar to how the Copy task has that option? We have numerous cases where some of our resources are placed in the actual source directory itself unfortunately. So by adding the source directory as a resources directory I end up with a huge output resources tree with mostly empty directories.

sourceSets.all {
  tasks[processResourcesTaskName].includeEmptyDirs = false
}

Or even:

tasks.withType(Copy) {
  includeEmptyDirs = false
}

Thanks. I didn’t realize the processResources task extended Copy.