繁体   English   中英

使用 Gradle 调用 powershell 脚本

[英]Calling a powershell script with Gradle

我是 Gradle 的新手,所以请耐心等待。我只是想调用一个 .ps1 文件来执行 gradle。 我将如何设置 build.gradle 文件以在同一目录中执行 .ps1 文件? 提前致谢!

您可以使用 gradle Exec

例子:

task execPs(type:Exec) {
   commandLine 'cmd', '/c', 'Powershell  -File  sample.ps1'
}
// add this task to your build.gradle file and execute gradle execPs
// You can use a different name for this task 
// You can add a dependency to include this task as part of your normal build. (like below) 
// build.finalizedBy(execPs)
// with the above command gradle build will call your task at the end of build

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM