我正在使用下面的插件來自動管理補丁版本。
id "com.zoltu.git-versioning" version "3.0.3"
基本上,上述插件需要使用 v.major.minor 約定標記代碼。所以,我已經用 v0.1 標記了代碼,并且可以從 HEAD 訪問該標記。
但我仍然低于錯誤 -
- 出了什么問題:評估根專案“報告服務”時出現問題。
您的存盤庫中必須至少有一個標簽才能使 git-versioning 作業。推薦解決方案:git tag v0.0
并git tag顯示有一個標簽,我檢查了修訂歷史,這個標簽可以從我正在處理的分支訪問 -
$ git tag
v0.1
有沒有人知道問題是什么。這對我來說是一個障礙。
提前感謝您的幫助..
uj5u.com熱心網友回復:
這實際上來自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在評論中指出的那樣,檢查您的標簽是輕量級的還是帶注釋的。
git describe默認情況下會忽略輕量級標簽。
在Zoltu/Gradle.Plugin.Versioningissue 25中,Micah Zoltu(該插件的維護者)提到具有:
- 更新了檔案
- 確定了
src/main/kotlin/com/zoltu/gradle/plugin/GitVersioning.kt允許使用輕量級標簽的可能修復 - 實作了它,但它需要 JGit 6.X 和更新版本的 Java,并且 GitHub 發布作業流被破壞了。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/503846.html
上一篇:無法決議配置“:app:releaseAnnotationProcessorClasspath”的所有檔案
下一篇:在gradlebuild之前在build.gradle.kts上運行Checkstyle并在出現問題時使構建失敗
