From 3cb281945e6bd29df245e1cb0c26de110a5686d8 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Wed, 13 Sep 2017 15:32:57 +0100 Subject: [PATCH] Alias when strings are a scala version --- main/src/main/scala/sbt/Cross.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main/src/main/scala/sbt/Cross.scala b/main/src/main/scala/sbt/Cross.scala index 3f9bca63a..c89c32db0 100644 --- a/main/src/main/scala/sbt/Cross.scala +++ b/main/src/main/scala/sbt/Cross.scala @@ -228,6 +228,8 @@ object Cross { val extracted = Project.extract(state) import extracted._ + type ScalaVersion = String + val (version, instance) = switch.version match { case ScalaHomeVersion(homePath, resolveVersion, _) => val home = IO.resolve(extracted.currentProject.base, homePath) @@ -241,11 +243,9 @@ object Cross { case NamedScalaVersion(v, _) => (v, None) } - val binaryVersion = CrossVersion.binaryScalaVersion(version) - def logSwitchInfo( - included: Seq[(ProjectRef, Seq[String])], - excluded: Seq[(ProjectRef, Seq[String])] + included: Seq[(ProjectRef, Seq[ScalaVersion])], + excluded: Seq[(ProjectRef, Seq[ScalaVersion])] ) = { instance.foreach { @@ -264,7 +264,7 @@ object Cross { def detailedLog(msg: => String) = if (switch.verbose) state.log.info(msg) else state.log.debug(msg) - def logProject: (ProjectRef, Seq[String]) => Unit = (proj, scalaVersions) => { + def logProject: (ProjectRef, Seq[ScalaVersion]) => Unit = (proj, scalaVersions) => { val current = if (proj == currentRef) "*" else " " detailedLog(s" $current ${proj.project} ${scalaVersions.mkString("(", ", ", ")")}") } @@ -281,6 +281,7 @@ object Cross { logSwitchInfo(projectScalaVersions, Nil) structure.allProjectRefs ++ structure.units.keys.map(BuildRef.apply) } else { + val binaryVersion = CrossVersion.binaryScalaVersion(version) val (included, excluded) = projectScalaVersions.partition { case (_, scalaVersions) =>