mirror of https://github.com/sbt/sbt.git
More refined, and manual, activation of scripted
Allows to do a `sbt ++2.11.11 test:compile`, without the sbt plugin modules or scripted being an issue.
This commit is contained in:
parent
6f37e95be6
commit
948361e429
|
|
@ -240,7 +240,7 @@ lazy val `sbt-shared` = project
|
|||
|
||||
lazy val `sbt-coursier` = project
|
||||
.dependsOn(coreJvm, cache, extra, `sbt-shared`)
|
||||
.enablePlugins(ScriptedPlugin)
|
||||
.disablePlugins(ScriptedPlugin)
|
||||
.settings(
|
||||
plugin,
|
||||
utest
|
||||
|
|
@ -248,7 +248,7 @@ lazy val `sbt-coursier` = project
|
|||
|
||||
lazy val `sbt-pgp-coursier` = project
|
||||
.dependsOn(`sbt-coursier`)
|
||||
.enablePlugins(ScriptedPlugin)
|
||||
.disablePlugins(ScriptedPlugin)
|
||||
.settings(
|
||||
plugin,
|
||||
libs ++= {
|
||||
|
|
@ -261,7 +261,8 @@ lazy val `sbt-pgp-coursier` = project
|
|||
)
|
||||
|
||||
lazy val `sbt-shading` = project
|
||||
.enablePlugins(ScriptedPlugin, ShadingPlugin)
|
||||
.enablePlugins(ShadingPlugin)
|
||||
.disablePlugins(ScriptedPlugin)
|
||||
.dependsOn(`sbt-coursier`)
|
||||
.settings(
|
||||
plugin,
|
||||
|
|
|
|||
|
|
@ -2,11 +2,40 @@
|
|||
import sbt._
|
||||
import sbt.Defaults.itSettings
|
||||
import sbt.Keys._
|
||||
import sbt.ScriptedPlugin.autoImport.{ScriptedConf, ScriptedLaunchConf, scriptedSbt}
|
||||
import sbt.ScriptedPlugin.{projectSettings => scriptedSettings}
|
||||
import sbt.librarymanagement.CrossVersion.partialVersion
|
||||
|
||||
object Aliases {
|
||||
|
||||
def libs = libraryDependencies
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
def hasITs = itSettings
|
||||
|
||||
def ShadingPlugin = coursier.ShadingPlugin
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ object Settings {
|
|||
lazy val plugin =
|
||||
javaScalaPluginShared ++
|
||||
divertThingsPlugin ++
|
||||
withScriptedTests ++
|
||||
Seq(
|
||||
scriptedLaunchOpts ++= Seq(
|
||||
"-Xmx1024M",
|
||||
|
|
|
|||
Loading…
Reference in New Issue