Skip to content

Commit

Permalink
Merge pull request #581 from fthomas/topic/one-sbt-file
Browse files Browse the repository at this point in the history
Put all global sbt plugins in scala-steward.sbt
  • Loading branch information
fthomas authored Jun 16, 2019
2 parents 4f91724 + 63fe059 commit 541b844
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ object SbtAlg {
override def addGlobalPlugins: F[Unit] =
for {
_ <- logger.info("Add global sbt plugins")
_ <- addGlobalPlugin(sbtScalafixPlugin)
_ <- addGlobalPlugin(sbtUpdatesPlugin)
_ <- addGlobalPlugin(scalaStewardSbt)
_ <- addGlobalPlugin(stewardPlugin)
} yield ()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ package object sbt {
case _ => defaultSbtVersion
}

val sbtScalafixPlugin: FileData =
FileData("sbt-scalafix.sbt", """addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.5")""")

val sbtUpdatesPlugin: FileData =
FileData("sbt-updates.sbt", """addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0")""")
val scalaStewardSbt: FileData =
FileData(
"scala-steward.sbt",
"""addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.5")
|addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0")
""".stripMargin
)

val stewardPlugin: FileData = {
val name = "StewardPlugin.scala"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ class SbtAlgTest extends FunSuite with Matchers {
test("addGlobalPlugins") {
sbtAlg.addGlobalPlugins.runS(MockState.empty).unsafeRunSync() shouldBe MockState.empty.copy(
commands = Vector(
List("write", "/tmp/steward/.sbt/0.13/plugins/sbt-scalafix.sbt"),
List("write", "/tmp/steward/.sbt/1.0/plugins/sbt-scalafix.sbt"),
List("write", "/tmp/steward/.sbt/0.13/plugins/sbt-updates.sbt"),
List("write", "/tmp/steward/.sbt/1.0/plugins/sbt-updates.sbt"),
List("write", "/tmp/steward/.sbt/0.13/plugins/scala-steward.sbt"),
List("write", "/tmp/steward/.sbt/1.0/plugins/scala-steward.sbt"),
List("write", "/tmp/steward/.sbt/0.13/plugins/StewardPlugin.scala"),
List("write", "/tmp/steward/.sbt/1.0/plugins/StewardPlugin.scala")
),
logs = Vector((None, "Add global sbt plugins")),
files = Map(
File("/tmp/steward/.sbt/0.13/plugins/sbt-scalafix.sbt") -> sbtScalafixPlugin.content,
File("/tmp/steward/.sbt/1.0/plugins/sbt-scalafix.sbt") -> sbtScalafixPlugin.content,
File("/tmp/steward/.sbt/0.13/plugins/sbt-updates.sbt") -> sbtUpdatesPlugin.content,
File("/tmp/steward/.sbt/1.0/plugins/sbt-updates.sbt") -> sbtUpdatesPlugin.content,
File("/tmp/steward/.sbt/0.13/plugins/scala-steward.sbt") -> scalaStewardSbt.content,
File("/tmp/steward/.sbt/1.0/plugins/scala-steward.sbt") -> scalaStewardSbt.content,
File("/tmp/steward/.sbt/0.13/plugins/StewardPlugin.scala") -> stewardPlugin.content,
File("/tmp/steward/.sbt/1.0/plugins/StewardPlugin.scala") -> stewardPlugin.content
)
Expand Down

0 comments on commit 541b844

Please sign in to comment.