【发布时间】:2019-10-11 23:12:35
【问题描述】:
我正在使用https://github.com/sbt/sbt-git 来获得自动版本控制的好处,如使用 Git 进行版本控制部分中的描述。
我的build.sbt 文件如下所示:
version := "0.1.0"
scalaVersion := "2.12.8"
scalacOptions ++= Seq(
"-encoding", "UTF-8", // source files are in UTF-8
"-deprecation", // warn about use of deprecated APIs
"-unchecked", // warn about unchecked type parameters
"-feature", // warn about misused language features
"-language:higherKinds", // allow higher kinded types without `import scala.language.higherKinds`
"-Xlint", // enable handy linter warnings
"-Xfatal-warnings", // turn compiler warnings into errors
"-Ypartial-unification" // allow the compiler to unify type constructors of different arities
)
scalacOptions in(Compile, console) ~= {
_.filterNot(Set("-Xlint"))
}
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "1.6.0",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2"
)
libraryDependencies ++= Seq(
"org.scalacheck" %% "scalacheck" % "1.14.0" % "test",
"org.scalactic" %% "scalactic" % "3.0.6" % "test",
"org.scalatest" %% "scalatest" % "3.0.6" % "test"
)
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-slf4j" % "2.5.22",
"ch.qos.logback" % "logback-classic" % "1.2.3"
)
libraryDependencies += "com.dimafeng" %% "testcontainers-scala" % "0.25.0" % "test"
enablePlugins(JavaServerAppPackaging)
enablePlugins(DockerPlugin)
enablePlugins(GitVersioning)
dockerExposedPorts := Seq(8080)
git.formattedShaVersion := git.gitHeadCommit.value map { sha =>
s"$sha".substring(0, 7)
}
dockerUpdateLatest := true
dockerAlias := DockerAlias(None, Some("zerocoder"), (packageName in Docker).value, git.gitDescribedVersion.value)
提交后,它不会自动从版本“0.1.0”增加到“0.2.0”。
我做错了什么?
【问题讨论】: