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
|
lazy val `sbt-coursier` = project
|
||||||
.dependsOn(coreJvm, cache, extra, `sbt-shared`)
|
.dependsOn(coreJvm, cache, extra, `sbt-shared`)
|
||||||
.enablePlugins(ScriptedPlugin)
|
.disablePlugins(ScriptedPlugin)
|
||||||
.settings(
|
.settings(
|
||||||
plugin,
|
plugin,
|
||||||
utest
|
utest
|
||||||
|
|
@ -248,7 +248,7 @@ lazy val `sbt-coursier` = project
|
||||||
|
|
||||||
lazy val `sbt-pgp-coursier` = project
|
lazy val `sbt-pgp-coursier` = project
|
||||||
.dependsOn(`sbt-coursier`)
|
.dependsOn(`sbt-coursier`)
|
||||||
.enablePlugins(ScriptedPlugin)
|
.disablePlugins(ScriptedPlugin)
|
||||||
.settings(
|
.settings(
|
||||||
plugin,
|
plugin,
|
||||||
libs ++= {
|
libs ++= {
|
||||||
|
|
@ -261,7 +261,8 @@ lazy val `sbt-pgp-coursier` = project
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val `sbt-shading` = project
|
lazy val `sbt-shading` = project
|
||||||
.enablePlugins(ScriptedPlugin, ShadingPlugin)
|
.enablePlugins(ShadingPlugin)
|
||||||
|
.disablePlugins(ScriptedPlugin)
|
||||||
.dependsOn(`sbt-coursier`)
|
.dependsOn(`sbt-coursier`)
|
||||||
.settings(
|
.settings(
|
||||||
plugin,
|
plugin,
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,40 @@
|
||||||
import sbt._
|
import sbt._
|
||||||
import sbt.Defaults.itSettings
|
import sbt.Defaults.itSettings
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
|
import sbt.ScriptedPlugin.autoImport.{ScriptedConf, ScriptedLaunchConf, scriptedSbt}
|
||||||
|
import sbt.ScriptedPlugin.{projectSettings => scriptedSettings}
|
||||||
|
import sbt.librarymanagement.CrossVersion.partialVersion
|
||||||
|
|
||||||
object Aliases {
|
object Aliases {
|
||||||
|
|
||||||
def libs = libraryDependencies
|
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 hasITs = itSettings
|
||||||
|
|
||||||
def ShadingPlugin = coursier.ShadingPlugin
|
def ShadingPlugin = coursier.ShadingPlugin
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@ object Settings {
|
||||||
lazy val plugin =
|
lazy val plugin =
|
||||||
javaScalaPluginShared ++
|
javaScalaPluginShared ++
|
||||||
divertThingsPlugin ++
|
divertThingsPlugin ++
|
||||||
|
withScriptedTests ++
|
||||||
Seq(
|
Seq(
|
||||||
scriptedLaunchOpts ++= Seq(
|
scriptedLaunchOpts ++= Seq(
|
||||||
"-Xmx1024M",
|
"-Xmx1024M",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue