Closed dh12313012 closed 4 years ago
plugins.sbt
contains sbt-git
:
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.7.4")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.0")
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5")
addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
Hi @dh12313012 ! I think git.gitDescribedVersion.value.get
when you're trying to start sbt project outside of a folder git / repo without commits / etc; try the following:
version := {
if(git.gitHeadCommit.value.isEmpty) "0.0.1-SNAPSHOT"
else if (git.gitDescribedVersion.value.isEmpty)
git.gitHeadCommit.value.get.substring(0, 7) + "-SNAPSHOT"
else if (git.gitCurrentTags.value.isEmpty || git.gitUncommittedChanges.value)
git.gitDescribedVersion.value.get + "-SNAPSHOT"
else
git.gitDescribedVersion.value.get
}
Hi, @pomadchin !Thanks for your help. This modification solved my problem. 👍
Because of network limitations, i use
sbt shell
build this project. And system report an error :build.sbt
context :system warn that
git.gitDescribedVersion.value.get + "-SNAPSHOT"
errorsI am a nood in sbt, how to resolve this problem?