无法从 gradle 文件执行 shell 脚本

Cannot execute a shell script from gradle file

我正在使用 TeamCity 作为我的 CI 服务器。我有一个 android 项目的 build.gradle 文件,其中包含

android{project.afterEvaluate{
task packDex(type:Exec)  {
    ....
    commandLine './script.sh'
    .....
}
}

在构建我的项目时出现 org.gradle.process.internal.ExecException 错误。我该如何解决这个问题。它在 Android Studio 中构建,但不在 TeamCity 中构建。我正在使用 gradle 包装器构建我的 project.Please 帮助我。

编辑:

我的简单疑问是命令 commandLine './script.sh'build.gradle 启动 shell 脚本是否正确 file.I 我正在使用 Mac 作为我的服务器并使用 gradle 1.0.0

我设法解决了这个问题 myself.Just 使用以下代码。

android{project.afterEvaluate{
task packDex(type:Exec)  {
....
commandLine 'sh', './myScript.sh'
.....
}
}