mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Adopt to new loggin api
This commit is contained in:
36
project/TestSettings.scala
Normal file
36
project/TestSettings.scala
Normal file
@ -0,0 +1,36 @@
|
||||
import sbt._
|
||||
import sbt.Keys._
|
||||
import docspell.build._
|
||||
import sbtcrossproject.CrossProject
|
||||
|
||||
object TestSettingsPlugin extends AutoPlugin {
|
||||
|
||||
object autoImport {
|
||||
def inTest(d0: Seq[ModuleID], ds: Seq[ModuleID]*) =
|
||||
ds.fold(d0)(_ ++ _).map(_ % Test)
|
||||
|
||||
implicit class ProjectTestSettingsSyntax(project: Project) {
|
||||
def withTestSettings =
|
||||
project.settings(testSettings)
|
||||
|
||||
def withTestSettingsDependsOn(p: Project, ps: Project*) =
|
||||
(p :: ps.toList).foldLeft(project) { (cur, dep) =>
|
||||
cur.dependsOn(dep % "test->test,compile")
|
||||
}
|
||||
}
|
||||
|
||||
implicit class CrossprojectTestSettingsSyntax(project: CrossProject) {
|
||||
def withTestSettings =
|
||||
project.settings(testSettings)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
import autoImport._
|
||||
|
||||
val testSettings = Seq(
|
||||
libraryDependencies ++= inTest(Dependencies.munit, Dependencies.logging),
|
||||
testFrameworks += new TestFramework("munit.Framework")
|
||||
)
|
||||
|
||||
}
|
Reference in New Issue
Block a user