相关疑难解决方法(0)

你如何支持Mac和PC的Gradle Exec任务?

如果命令采用不同的形式,是否有办法在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做到这一点?

windows macos gradle

23
推荐指数
2
解决办法
7789
查看次数

标签 统计

gradle ×1

macos ×1

windows ×1