Gradle — execute multiple commands from task

前端 未结 4 2050
-上瘾入骨i
-上瘾入骨i 2020-12-30 21:14

I have 2 separate apps (in one project) that require 2 separate builds (sencha cmd). I have been asked to create a gradle script that will do the builds for both apps.

4条回答
  •  时光说笑
    2020-12-30 21:47

    Use .execute() at doLast block

    task myTask(group: "my-group") {
           doLast {
                 println "Starting..."
                 println "echo \"MyEcho1\"".execute().text.trim()
                 println "echo \"MyEcho2\"".execute().text.trim()
           }
        }
    

提交回复
热议问题