In the current implementation, copyExecutable does not favor the original file permission except the file owner:
/** Transfers the executable property of `sourceFile` to `targetFile`. */
def copyExecutable(sourceFile: File, targetFile: File) = {
val executable = sourceFile.canExecute
if (executable) targetFile.setExecutable(true) /// equivalent to setExecutable(executable=true, ownerOnly=true)
}
For example, if the original file permission is 775 (rwxrwxr-x), and copied by sbt.io.IO.copyExecutable, it will results in 764 (rwxrw-r--) executable flag are removed from the group and others).
We've found this issue in xerial/sbt-pack#135