2017-04-02 21:51:11 +02:00
|
|
|
|
|
|
|
|
import sbt._
|
|
|
|
|
import sbt.Defaults.itSettings
|
|
|
|
|
import sbt.Keys._
|
2017-11-01 00:27:45 +01:00
|
|
|
import sbt.ScriptedPlugin.autoImport.{ScriptedConf, ScriptedLaunchConf, scriptedSbt}
|
|
|
|
|
import sbt.ScriptedPlugin.{projectSettings => scriptedSettings}
|
|
|
|
|
import sbt.librarymanagement.CrossVersion.partialVersion
|
2017-04-02 21:51:11 +02:00
|
|
|
|
|
|
|
|
object Aliases {
|
|
|
|
|
|
|
|
|
|
def libs = libraryDependencies
|
|
|
|
|
|
2017-11-01 00:27:45 +01:00
|
|
|
def withScriptedTests =
|
|
|
|
|
// see https://github.com/sbt/sbt/issues/3325#issuecomment-315670424
|
|
|
|
|
scriptedSettings.filterNot(_.key.key.label == libraryDependencies.key.label) ++ Seq(
|
|
|
|
|
libraryDependencies ++= {
|
|
|
|
|
scalaBinaryVersion.value match {
|
|
|
|
|
case "2.10" | "2.12" =>
|
|
|
|
|
partialVersion(scriptedSbt.value) match {
|
|
|
|
|
case Some((0, 13)) =>
|
|
|
|
|
Seq(
|
|
|
|
|
"org.scala-sbt" % "scripted-sbt" % scriptedSbt.value % ScriptedConf,
|
|
|
|
|
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % ScriptedLaunchConf
|
|
|
|
|
)
|
|
|
|
|
case Some((1, _)) =>
|
|
|
|
|
Seq(
|
|
|
|
|
"org.scala-sbt" %% "scripted-sbt" % scriptedSbt.value % ScriptedConf,
|
|
|
|
|
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % ScriptedLaunchConf
|
|
|
|
|
)
|
|
|
|
|
case other =>
|
|
|
|
|
sys.error(s"Unrecognized sbt partial version: $other")
|
|
|
|
|
}
|
|
|
|
|
case _ =>
|
|
|
|
|
Seq()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2017-04-02 21:51:11 +02:00
|
|
|
def hasITs = itSettings
|
|
|
|
|
|
|
|
|
|
def ShadingPlugin = coursier.ShadingPlugin
|
|
|
|
|
|
2017-05-15 15:32:48 +02:00
|
|
|
def root = file(".")
|
|
|
|
|
|
2017-05-15 15:32:48 +02:00
|
|
|
|
|
|
|
|
implicit class ProjectOps(val proj: Project) extends AnyVal {
|
|
|
|
|
def dummy: Project =
|
|
|
|
|
proj.in(file(s"target/${proj.id}"))
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-02 21:51:11 +02:00
|
|
|
}
|