java - 如何在 gradle 文件中的一个任务中执行多个 shell 脚本
问题描述
我是 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'
}
}
}
推荐阅读
- java - 如何使用 Android 的 JSON 从网站接收数据?
- php - PHP Wordpress 插件变量不与内联样式相呼应
- npm-install - 找不到多主模块中的错误:'babel'
- c# - \charscalexN 不能在 RichTextBox 上工作
- php - Symfony 4:Doctrine-entity 根据 ROLE_* 返回不同的数据
- c# - 一个公钥多个私钥
- java - AsyncTask doInBackground 中的 NetworkOnMainThreadException
- javascript - 如何绑定一个Ember中元素的open属性?
- python - 如何使用 string.punctuation 删除文本文件中的标点符号
- r - 基于匹配整个字符串的前瞻正则表达式在 R 中附加单元格