mirror of
https://github.com/sbt/sbt.git
synced 2026-10-06 18:14:04 +02:00
Port sbt-cross-building's ^ and ^^ commands
This ports sbt-cross-building's cross (`^`) and switch (`^^`) commands. Instead of making it a plugin, the default settings are now changed to use `sbtVersion in pluginCrossBuild` for the sbt dependency.
This commit is contained in:
@@ -9,6 +9,7 @@ import complete.{ Parser, DefaultParsers }
|
||||
import classpath.ClasspathUtilities
|
||||
import java.lang.reflect.{ InvocationTargetException, Method }
|
||||
import java.util.Properties
|
||||
import CrossVersion.binarySbtVersion
|
||||
|
||||
object ScriptedPlugin extends Plugin {
|
||||
def scriptedConf = config("scripted-sbt") hide
|
||||
@@ -97,13 +98,23 @@ object ScriptedPlugin extends Plugin {
|
||||
|
||||
val scriptedSettings = Seq(
|
||||
ivyConfigurations ++= Seq(scriptedConf, scriptedLaunchConf),
|
||||
scriptedSbt := sbtVersion.value,
|
||||
scriptedSbt := (sbtVersion in pluginCrossBuild).value,
|
||||
sbtLauncher <<= getJars(scriptedLaunchConf).map(_.get.head),
|
||||
sbtTestDirectory := sourceDirectory.value / "sbt-test",
|
||||
libraryDependencies ++= Seq(
|
||||
"org.scala-sbt" % "scripted-sbt" % scriptedSbt.value % scriptedConf.toString,
|
||||
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % scriptedLaunchConf.toString
|
||||
),
|
||||
libraryDependencies ++= {
|
||||
binarySbtVersion(scriptedSbt.value) match {
|
||||
case "0.13" =>
|
||||
Seq(
|
||||
"org.scala-sbt" % "scripted-sbt" % scriptedSbt.value % scriptedConf.toString,
|
||||
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % scriptedLaunchConf.toString
|
||||
)
|
||||
case sv if sv startsWith "1.0." =>
|
||||
Seq(
|
||||
"org.scala-sbt" %% "scripted-sbt" % scriptedSbt.value % scriptedConf.toString,
|
||||
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % scriptedLaunchConf.toString
|
||||
)
|
||||
}
|
||||
},
|
||||
scriptedBufferLog := true,
|
||||
scriptedClasspath := getJars(scriptedConf).value,
|
||||
scriptedTests <<= scriptedTestsTask,
|
||||
|
||||
Reference in New Issue
Block a user