What would it take to adjust Gradle so that Copy/Sync tasks preserve file permissions?

What would it take to fix GRADLE-971 so that Copy/Sync tasks preserve file permissions?

Currently, the best work-around seems to require explicitly enumerating files that need to be executable, excluding them from the copyspec in some way, and then creating a second copyspec that explicitly enumerates those same files as includes with an explicit ‘fileMode’.

Having to do so represents a duplication of information (e.g., script permissions are already tracked by my version control system, and also we have to enumerate files twice) and thus one source is always likely to be out of date (unfortunately, the one in ‘build.gradle’).

It looks like it might be as easy as having ‘AbstractFileTreeElement#copyFile(File)’ check ‘canExecute’ on the source file and then calling ‘setExecute’ on the destination? Though, there’s probably much more to be verified. Is there some reason that this has not yet been fixed?

Thanks.

There’s a pull request queued up that fixes this, waiting to be applied. We will apply it after Gradle 1.0-milestone-8 is out (ie soon).

Great to hear.