gpt4 book ai didi

powershell - 用Gradle调用Powershell脚本

转载 作者:行者123 更新时间:2023-12-02 23:53:14 26 4
gpt4 key购买 nike

我是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

关于powershell - 用Gradle调用Powershell脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52931567/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com