gradle 执行:找不到命令

gradle Exec: could not find command

Gradle 执行:无法在 windows

上找到命令
task runTest(type: Exec) {
    workingDir "$buildDir/test"
    commandLine 'test.bat'
}

错误:

Caused by: java.io.IOException: Cannot run program "test.bat" (in directory 
"e:\foo\build\test"): CreateProcess error=2, The system cannot find the file 
specified

但是test.bat在目录下。我可以转到目录并手动 运行 命令

你能试试吗:

task runTest(type: Exec) {
    workingDir "$buildDir/test"
    commandLine 'cmd', '/c', 'test.bat'
}

docs.