且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用Gradle调用Powershell脚本

更新时间:2023-12-05 13:12:22

您可以使用gradle

You can use 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