有一个
open issue
现在你可以检测符号链接,也许可以手动创建它
import java.nio.file.FileSystems
import java.nio.file.Files
import java.nio.file.Path
copy {
from $source
into $destination
eachFile { details ->
Path pathFile = FileSystems.getDefault().getPath(details.file.path)
if(Files.isSymbolicLink(pathFile)) {
details.exclude()
commandLine 'ln', '-s', Files.readSymbolicLink(pathFile), "$destination/${details.relativePath}
}
}
}