我按照了这个sbt插件的自述文件:https://github.com/sbt/sbt-buildinfo,但我的项目没有生成任何BuildInfo.scala
,也没有发生错误。
我创建了一个非常简单的sbt项目来显示我的代码:https://github.com/freewind/sbt-buildinfo-test
您可以克隆它并尝试一下。我不确定我错过了什么。
答案 0 :(得分:4)
BuildInfo.scala
在target/scala-2.11/src_managed/main/sbt-buildinfo
生成:
package hello
import java.io.File
import java.net.URL
/** This object was generated by sbt-buildinfo. */
case object BuildInfo {
/** The value is "sbt-buildinfo-test". */
val name: String = "sbt-buildinfo-test"
/** The value is "1.0". */
val version: String = "1.0"
/** The value is "2.11.6". */
val scalaVersion: String = "2.11.6"
override val toString: String = "name: %s, version: %s, scalaVersion: %s" format (name, version, scalaVersion)
}