【发布时间】:2015-02-08 22:41:23
【问题描述】:
如果命令采用不同的形式,有没有办法能够在 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'
}
你会如何在 Gradle 中做到这一点?
【问题讨论】: