gpt4 book ai didi

git - 面对 gradle git zoltu 插件的问题?

转载 作者:行者123 更新时间:2023-12-05 05:35:21 25 4
gpt4 key购买 nike

我正在使用下面的插件来自动管理补丁版本。

id "com.zoltu.git-versioning" version "3.0.3"

基本上,上述插件需要使用 v.major.minor 约定标记代码。所以,我用 v0.1 标记了代码,并且可以从 HEAD 访问该标记。

但我仍然低于错误 -

  • What went wrong: A problem occurred evaluating root project 'report-service'.

Your repository must have at least one tag in it for git-versioning to work. Recommended solution: git tag v0.0

git tag 显示有一个标签,我已经检查了修订历史,并且可以从我正在处理的分支访问这个标签 -

$ git tag
v0.1

有没有人知道问题出在哪里。这对我来说是个阻碍。
在此先感谢您的帮助..

最佳答案

这实际上来自Zoltu/Gradle.Plugin.Versioning kotlin/com/zoltu/gradle/plugin/GitVersioning.kt

    private fun getGitDescribeResults(rootDirectory: File): String {
val repository = FileRepositoryBuilder()
.findGitDir(rootDirectory)!!
.apply { gitDir ?: throw Exception("Project must be in a git directory for git-versioning to work. Recommended solution: git init") }
.build()!!
val git = Git.wrap(repository)!!
if (git.repository.allRefs.count() == 0) throw Exception("Your repository must have at least one commit in the repository for git-versioning to work. Recommended solution: git commit")
return git.describe().setLong(true).call() ?: throw Exception("Your repository must have at least one tag in it for git-versioning to work. Recommended solution: git tag v0.0")
}

torek 所述在 the comments , 检查你的 tag is lightweight or annotated .
git describeby default ignore lightweight tags .


Zoltu/Gradle.Plugin.Versioning issue 25 , Micah Zoltu (该插件的维护者)提到有:

关于git - 面对 gradle git zoltu 插件的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73538054/

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