我需要在 gradle build 脚本中添加一个创建符号链接的命令。我知道构建安装了 cygwin 的人。问题出在导出命令上。这是我到目前为止得到的
if(OS == 'win32') {
exec { commandLine "C:\\cygwin\\bin\\mintty.exe", "--hold always", "/bin/bash", "-l", "-e", "export", "CYGWIN=winsymlinks", "&&", "-e", "ln", "-s", link, file}
//exec { commandLine "cmd", "/c", "mklink", link, file}
//exec { commandLine "export", "CYGWIN=winsymlinks" }
//exec { commandLine "C:\\cygwin\\bin\\ln.exe" , "-s", link, file}
}
else {
exec { commandLine "ln", "-s", link, file}
}
有标准的做法吗?