sbt 0.13.X-如何检查所有用户定义的键?

时间:2018-10-26 05:21:55

标签: scala sbt sbt-0.13

假设我有一个Build.scala文件:

import sbt._

/**
  * In order to share code between .sbt files, define one or more Scala files
  * in the project/ directory of the build root.
  */
object HelloBuild extends Build {
  val sampleKeyA = settingKey[String]("demo key A")
  val sampleKeyB = settingKey[String]("demo key B")
  val sampleKeyC = settingKey[String]("demo key C")
  val sampleKeyD = settingKey[String]("demo key D")
  override lazy val settings = super.settings ++
    Seq(
      sampleKeyA := "A: in Build.settings in Build.scala",
      resolvers := Seq()
    )
  lazy val root = Project(id = "hello",
    base = file("."),
    settings = Seq(
      sampleKeyB := "B: in the root project settings in Build.scala"
    ))
}

extends Build已过时,因此我想将此Build.scala文件替换为build.sbt文件,但我希望我的新build.sbt文件产生的用户完全相同,将键定义为旧的Build.scala文件。我希望能够检查旧Build.scala文件中的每个键,并确保输出与检查新build.sbt文件中的每个设置键相同。

执行此操作的一种方法是在迁移前后对每个单个键执行inspect key,并确保输出相同。真痛苦我想一次检查所有用户定义的键。有没有办法在sbt 0.13.X中做到这一点?

更新:我发现这有助于迁移:

https://www.scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html

0 个答案:

没有答案