簡體   English   中英

如何在Gradle文件中的任務中執行多個Shell腳本

[英]How to execute more than one shell scripts in a task in gradle file

我是gradle的新手,我有一個場景,我需要在gradle的單個任務中執行2個Shell腳本。

我嘗試了以下操作,但未執行script1.sh任務。

task downloadtheArtifacts(type: Exec) {
    commandLine './script1.sh'
    commandLine './script2.sh'
}

請讓我知道我該如何解決?

嘗試:

task downloadtheArtifacts {
    doLast {
        exec {
            commandLine './script1.sh'
        }
        exec {
            commandLine './script2.sh'
        }
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM