mirror of https://github.com/sbt/sbt.git
Merge pull request #7815 from xuwei-k/CompatParColls
[2.x] delete `sbt.internal.CompatParColls`
This commit is contained in:
commit
efc41bd8d8
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* sbt
|
||||
* Copyright 2023, Scala center
|
||||
* Copyright 2011 - 2022, Lightbend, Inc.
|
||||
* Copyright 2008 - 2010, Mark Harrah
|
||||
* Licensed under Apache License 2.0 (see LICENSE)
|
||||
*/
|
||||
|
||||
package sbt.internal
|
||||
|
||||
import scala.annotation.nowarn
|
||||
|
||||
// https://github.com/scala/scala-parallel-collections/issues/22
|
||||
private[sbt] object CompatParColls {
|
||||
@nowarn
|
||||
val Converters = {
|
||||
import Compat._
|
||||
{
|
||||
import scala.collection.parallel._
|
||||
CollectionConverters
|
||||
}
|
||||
}
|
||||
object Compat {
|
||||
object CollectionConverters
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ object KeyIndex {
|
|||
projects: Map[URI, Set[String]],
|
||||
configurations: Map[String, Seq[Configuration]]
|
||||
): ExtendableKeyIndex = {
|
||||
import sbt.internal.CompatParColls.Converters._
|
||||
import scala.collection.parallel.CollectionConverters.*
|
||||
known.par.foldLeft(base(projects, configurations)) { _ add _ }
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ object KeyIndex {
|
|||
* This was a significant serial bottleneck during project loading that we can work around by
|
||||
* computing the aggregations in parallel and then bulk adding them to the index.
|
||||
*/
|
||||
import sbt.internal.CompatParColls.Converters._
|
||||
import scala.collection.parallel.CollectionConverters.*
|
||||
val toAggregate = known.par.map {
|
||||
case key if validID(key.key.label) =>
|
||||
Aggregation.aggregate(key, ScopeMask(), extra, reverse = true)
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ private[sbt] object Definition {
|
|||
log.debug(s"symbol $sym")
|
||||
analyses
|
||||
.map { analyses =>
|
||||
import sbt.internal.CompatParColls.Converters._
|
||||
import scala.collection.parallel.CollectionConverters.*
|
||||
val locations = analyses.par.flatMap { analysis =>
|
||||
val selectPotentials = textProcessor.potentialClsOrTraitOrObj(sym)
|
||||
val classes =
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ private[sbt] object Settings {
|
|||
* input key.
|
||||
*/
|
||||
private[sbt] def fileStamps(scopedKey: Def.ScopedKey[_]): Def.Setting[_] = {
|
||||
import sbt.internal.CompatParColls.Converters._
|
||||
import scala.collection.parallel.CollectionConverters.*
|
||||
val scope = scopedKey.scope
|
||||
addTaskDefinition(scope / Keys.inputFileStamps := {
|
||||
val cache = (scope / unmanagedFileStampCache).value
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ class ScriptedRunner {
|
|||
val scriptedRunners =
|
||||
runner.batchScriptedRunner(scriptedTests, addTestFile, groupCount, prop, logger)
|
||||
if (parallelExecution && instances > 1) {
|
||||
import sbt.internal.CompatParColls.Converters._
|
||||
import scala.collection.parallel.CollectionConverters.*
|
||||
val parallelRunners = scriptedRunners.toArray.par
|
||||
parallelRunners.tasksupport = new ForkJoinTaskSupport(new ForkJoinPool(instances))
|
||||
runAll(parallelRunners)
|
||||
|
|
|
|||
Loading…
Reference in New Issue