6502-opcodes/project/ProjectPlugin.scala
2024-06-05 10:16:08 -04:00

40 lines
1.1 KiB
Scala

import sbt.Keys.*
import sbt.*
object ProjectPlugin extends AutoPlugin {
override def trigger = allRequirements
val autoImport = ThingsToImport
object ThingsToImport {
private def jarName(s: String) =
"firepower-" + s
def module(s: String): Project =
Project(s, file(jarName(s)))
.settings(name := jarName(s))
implicit class ProjectOps(p: Project) {
def withCats: Project =
p.settings(libraryDependencies += "org.typelevel" %% "cats-core" % "2.12.0")
def withEfectMonad: Project =
p.settings(libraryDependencies += "dev.zio" %% "zio" % "2.0.4")
def withTesting: Project = {
val weaverVersion =
"0.8.4"
p.settings(
testFrameworks += new TestFramework("weaver.framework.CatsEffect"),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.16" % Test,
"com.disneystreaming" %% "weaver-cats" % weaverVersion % Test,
"com.disneystreaming" %% "weaver-scalacheck" % weaverVersion % Test
)
)
}
}
}
}