gradle - Gradle exec 任务因“execCommand == null!”而失败
问题描述
我正在尝试在我的 build.gradle.kts 上创建一个版本缓冲和标签创建器,但是我收到了这个错误,有人可以帮助我吗?谢谢!
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':gitTag'.
> execCommand == null!
我的 build.gradle.kts
tasks {
val gitIsDirty by registering(Exec::class) {
description = "Fails if git has uncommitted changes."
group = "verification"
commandLine("git", "diff", "--quiet", "--exit-code")
}
val gitTag by registering(Exec::class) {
description = "Tags the local repository with version ${project.version}"
group = PublishingPlugin.PUBLISH_TASK_GROUP
dependsOn(gitIsDirty)
if (isRelease) {
commandLine("git", "commit", "-am", "Publishing version ${project.version}")
commandLine("git", "tag", "-a", project.version, "-m", "Version ${project.version}")
commandLine("git", "push", "origin", "${project.version}")
}
}
val publishLocalMajor by registering(Exec::class) {
group = PublishingPlugin.PUBLISH_TASK_GROUP
dependsOn(incrementMajor, gitTag,publishToMavenLocal)
}
}
解决方案
推荐阅读
- kotlin - kotlin暴露失败(插入成功,但选择失败)
- node.js - node-webcrypto-ossl,未找到 GLIBC_2.32,Manjaro 操作系统
- java - 从Android中的firebase下载多个文件时如何管理内存
- javascript - 使用脚本 ('http://xxx/firebase-messaging-sw.js') 为范围 ('http://xxx/firebase-cloud-messaging-push-scope') 注册 ServiceWorker 失败
- blazor - Blazor 的编辑上下文是否要求模型具有公共构造函数?
- forms - 无法提交表单选择选项Vuelidate
- java - 用空格数替换数字
- python - Python 3.9.6:如何在计时器达到 0 后解除图像
- css - 文本字段上的表单标签重叠 - CSS
- python-3.x - 更改数据集时此代码会发生什么