【问题标题】:Running shell script through gradle通过 gradle 运行 shell 脚本
【发布时间】:2016-03-08 19:05:11
【问题描述】:

所以我有一个准备好由 gradle 运行的 shell 脚本。问题是我不知道如何运行 shell 脚本。我希望在构建应用程序时运行脚本。这是第一次搞乱构建系统。我看着创建一个任务,但似乎没有从 app/build.gradle 文件中调用:

task runShellScript(type:Exec) {
doLast {
    println 'Shell Script finished'
}
executable './shell-script'

【问题讨论】:

标签: android shell gradle android-gradle-plugin


【解决方案1】:

build.gradle 中创建任务为:

task task_name(type: Exec) {
          commandLine './shell_script_name.sh'  
}

并运行为:

gradle task_name

【讨论】:

    猜你喜欢
    • 2011-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-15
    相关资源
    最近更新 更多