【问题标题】:No such file or directory when adding arguments to Gradle exec task向 Gradle exec 任务添加参数时没有这样的文件或目录
【发布时间】:2017-06-27 14:08:59
【问题描述】:

我正在制作运行 bash 脚本的任务

task wsUpload(type: Exec) {
  commandLine '../scripts/ws_upload.sh ' + rootProject.ext.VERSION_CODE
}

无论如何它会返回

Caused by: java.io.IOException: Cannot run program "../scripts/ws_upload.sh 30" .... No such file or directory

如果我在没有参数的情况下运行相同的命令

 task wsUpload(type: Exec) {
      commandLine '../scripts/ws_upload.sh'
    }

然后执行命令。我做错了什么?

【问题讨论】:

  • 需要单独添加args作为na数组

标签: gradle


【解决方案1】:

像这样添加参数

task wsUpload(type: Exec) {
      commandLine '../scripts/ws_upload.sh'
      args = ["args"]
    }

【讨论】:

    猜你喜欢
    • 2020-08-05
    • 2019-09-06
    • 2020-04-09
    • 2020-04-27
    • 2019-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多