mirror of https://github.com/sbt/sbt.git
Cross build collectionProj
This commit is contained in:
parent
e1c9ed5a55
commit
bc4fe0a31a
|
|
@ -108,7 +108,7 @@ def commonBaseSettings: Seq[Setting[_]] = Def.settings(
|
||||||
)
|
)
|
||||||
def commonSettings: Seq[Setting[_]] =
|
def commonSettings: Seq[Setting[_]] =
|
||||||
commonBaseSettings :+
|
commonBaseSettings :+
|
||||||
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.4" cross CrossVersion.binary)
|
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
|
||||||
def utilCommonSettings: Seq[Setting[_]] =
|
def utilCommonSettings: Seq[Setting[_]] =
|
||||||
commonBaseSettings :+ (crossScalaVersions := (scala212 :: scala213 :: Nil))
|
commonBaseSettings :+ (crossScalaVersions := (scala212 :: scala213 :: Nil))
|
||||||
|
|
||||||
|
|
@ -246,9 +246,14 @@ lazy val bundledLauncherProj =
|
||||||
val collectionProj = (project in file("internal") / "util-collection")
|
val collectionProj = (project in file("internal") / "util-collection")
|
||||||
.settings(
|
.settings(
|
||||||
testedBaseSettings,
|
testedBaseSettings,
|
||||||
|
utilCommonSettings,
|
||||||
Util.keywordsSettings,
|
Util.keywordsSettings,
|
||||||
name := "Collections",
|
name := "Collections",
|
||||||
libraryDependencies ++= Seq(sjsonNewScalaJson.value),
|
libraryDependencies ++= Seq(sjsonNewScalaJson.value),
|
||||||
|
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
|
||||||
|
case Some((2, major)) if major <= 12 => Seq()
|
||||||
|
case _ => Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0")
|
||||||
|
}),
|
||||||
mimaSettings,
|
mimaSettings,
|
||||||
mimaBinaryIssueFilters ++= Seq(
|
mimaBinaryIssueFilters ++= Seq(
|
||||||
// Added private[sbt] method to capture State attributes.
|
// Added private[sbt] method to capture State attributes.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2018, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under Apache License 2.0 (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package sbt.internal.util
|
||||||
|
import scala.collection.parallel.ParSeq
|
||||||
|
|
||||||
|
private[util] object Par {
|
||||||
|
def apply[R](s: Seq[R]): ParSeq[R] = s.par
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2018, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under Apache License 2.0 (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
package sbt.internal.util
|
||||||
|
import scala.collection.parallel.CollectionConverters._
|
||||||
|
import scala.collection.parallel.ParSeq
|
||||||
|
|
||||||
|
private[util] object Par {
|
||||||
|
def apply[R](s: Seq[R]): ParSeq[R] = s.par
|
||||||
|
}
|
||||||
|
|
@ -66,7 +66,7 @@ object IMap {
|
||||||
put(k, f(this get k getOrElse init))
|
put(k, f(this get k getOrElse init))
|
||||||
|
|
||||||
def mapValues[V2[_]](f: V ~> V2) =
|
def mapValues[V2[_]](f: V ~> V2) =
|
||||||
new IMap0[K, V2](backing.mapValues(x => f(x)))
|
new IMap0[K, V2](Map(backing.iterator.map { case (k, v) => k -> f(v) }.toArray: _*))
|
||||||
|
|
||||||
def mapSeparate[VL[_], VR[_]](f: V ~> λ[T => Either[VL[T], VR[T]]]) = {
|
def mapSeparate[VL[_], VR[_]](f: V ~> λ[T => Either[VL[T], VR[T]]]) = {
|
||||||
val mapped = backing.iterator.map {
|
val mapped = backing.iterator.map {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import scala.language.existentials
|
|
||||||
|
|
||||||
import Types._
|
import Types._
|
||||||
import sbt.util.Show
|
import sbt.util.Show
|
||||||
import Util.{ nil, nilSeq }
|
import Util.{ nil, nilSeq }
|
||||||
|
|
@ -242,7 +240,7 @@ trait Init[ScopeType] {
|
||||||
if (s.definitive) Vector(s) else ss :+ s
|
if (s.definitive) Vector(s) else ss :+ s
|
||||||
|
|
||||||
def addLocal(init: Seq[Setting[_]])(implicit scopeLocal: ScopeLocal): Seq[Setting[_]] =
|
def addLocal(init: Seq[Setting[_]])(implicit scopeLocal: ScopeLocal): Seq[Setting[_]] =
|
||||||
init.par.map(_.dependencies flatMap scopeLocal).toVector.flatten ++ init
|
Par(init).map(_.dependencies flatMap scopeLocal).toVector.flatten ++ init
|
||||||
|
|
||||||
def delegate(sMap: ScopedMap)(
|
def delegate(sMap: ScopedMap)(
|
||||||
implicit delegates: ScopeType => Seq[ScopeType],
|
implicit delegates: ScopeType => Seq[ScopeType],
|
||||||
|
|
@ -465,7 +463,7 @@ trait Init[ScopeType] {
|
||||||
def dependencies = settings.flatMap(_.dependencies)
|
def dependencies = settings.flatMap(_.dependencies)
|
||||||
// This is mainly for use in the cyclic reference error message
|
// This is mainly for use in the cyclic reference error message
|
||||||
override def toString =
|
override def toString =
|
||||||
s"Derived settings for ${key.label}, ${definedAtString(settings.map(_.setting))}"
|
s"Derived settings for ${key.label}, ${definedAtString(settings.map(_.setting).toSeq)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
// separate `derived` settings from normal settings (`defs`)
|
// separate `derived` settings from normal settings (`defs`)
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ object Dependencies {
|
||||||
val jansi = "org.fusesource.jansi" % "jansi" % "1.18"
|
val jansi = "org.fusesource.jansi" % "jansi" % "1.18"
|
||||||
val scalatest = "org.scalatest" %% "scalatest" % "3.0.8"
|
val scalatest = "org.scalatest" %% "scalatest" % "3.0.8"
|
||||||
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
|
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
|
||||||
val specs2 = "org.specs2" %% "specs2-junit" % "4.0.1"
|
val specs2 = "org.specs2" %% "specs2-junit" % "4.10.0"
|
||||||
val junit = "junit" % "junit" % "4.11"
|
val junit = "junit" % "junit" % "4.11"
|
||||||
val scalaVerify = "com.eed3si9n.verify" %% "verify" % "0.2.0"
|
val scalaVerify = "com.eed3si9n.verify" %% "verify" % "0.2.0"
|
||||||
val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1"
|
val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue