我是 Gradle 新手,所以请耐心等待。我只是想调用 .ps1 文件来使用 gradle 执行。我将如何设置 build.gradle 文件来执行同一目录中的 .ps1 文件?提前致谢!
你可以使用gradleExec https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html
Example:
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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)