Gradle exec任务因“;execCommand==null”;
我试图在build.gradle.kts上创建一个版本缓冲和标记创建者,但是我遇到了这个错误,有人能帮我吗?谢谢Gradle exec任务因“;execCommand==null”;,gradle,kotlin,Gradle,Kotlin,我试图在build.gradle.kts上创建一个版本缓冲和标记创建者,但是我遇到了这个错误,有人能帮我吗?谢谢 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':gitTag'. > execCommand == null! 我的身材.gradle.kts tasks { val gitIsDirty by registering(Exec::cla
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':gitTag'.
> execCommand == null!
我的身材.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)
}
}
如果您在没有
if(isRelease)
条件的情况下编写commandLine()
是否有效?是的,这是gradle.startParameter.taskNames中的varvar isRelease=“release”