gpt4 book ai didi

scala - git变量是什么样的轴?

转载 作者:行者123 更新时间:2023-12-01 19:35:04 27 4
gpt4 key购买 nike

我的 build.sbt 文件如下所示:

//Git settings
git.useGitDescribe := true
git.formattedShaVersion := git.gitHeadCommit.value map { _ =>
git.gitCurrentTags.value.head
}

Docker / dockerAlias := DockerAlias(None, Some("zerocoder"), (packageName in Docker).value, git.gitDescribedVersion.value)

lazy val root = (project in file("."))
.enablePlugins(DockerPlugin, JavaServerAppPackaging, GitVersioning)
.settings(
name := "plugger",
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",
"com.typesafe.akka" %% "akka-slf4j" % "2.5.22",
"io.circe" %% "circe-core" % "0.11.1",
"io.circe" %% "circe-generic" % "0.11.1",
"io.circe" %% "circe-parser" % "0.11.1",
"org.scala-lang" % "scala-library" % "2.12.8",
"com.typesafe.akka" %% "akka-actor" % "2.5.22",
"com.typesafe.akka" %% "akka-stream" % "2.5.22",
"com.typesafe.akka" %% "akka-http" % "10.1.8",
"com.typesafe.akka" %% "akka-stream-kafka" % "1.0.1",
"org.scalacheck" %% "scalacheck" % "1.14.0" % "test",
"org.scalactic" %% "scalactic" % "3.0.6" % "test",
"org.scalatest" %% "scalatest" % "3.0.6" % "test",
"com.dimafeng" %% "testcontainers-scala" % "0.25.0" % "test"
),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.3"),
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"))
}

)

如您所见,我正在使用 GitVersioning插件和什么样的轴范围是 git 变量?

Docker是一个作用域,dockerAlias在作用域中,那是因为我可以写Docker/dockerAlias

我也尝试编写 git/useGitDescribe 但它不起作用。

最佳答案

git 不在 sbt 的任何范围轴中。它只是一个保存键的对象:https://github.com/sbt/sbt-git/blob/v1.0.0/src/main/scala/com/typesafe/sbt/SbtGit.scala#L212

如您所见,它还重新限定了 ThisBuild 引用范围轴中的大部分键。我只见过 sbt-git 这样做,但效果是,如果你在项目设置中使用 git.baseVersion(即 .settings(..))那么它将在构建级别而不是项目级别保持定义。

关于scala - git变量是什么样的轴?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56348394/

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