有没有办法检测Groovy/Grails运行网站的平台(Window/Linux)?
如果命令采用不同的形式,是否有办法在Windows和Mac上执行任务?例如:
task stopTomcat(type:Exec) {
// use this command line if on Windows
commandLine 'cmd', '/c', 'stop.cmd'
// use the command line if on Mac
commandLine './stop.sh'
}
Run Code Online (Sandbox Code Playgroud)
你会怎么在Gradle做到这一点?