Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do resolutions within a module in parallel #391

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ lazy val `lm-coursier` = project
else lm2_13Version
},
"org.scalatest" %% "scalatest" % "3.2.11" % Test
),
) ++ {
if (scalaBinaryVersion.value == "2.12")
Seq()
else
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4")
},
Test / test := {
(publishLocal in customProtocolForTest212).value
(publishLocal in customProtocolForTest213).value
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package lmcoursier.internal

// This is required for jscala 2.12/2.13 compatibility for parallel collections
// (see https://github.com/scala/scala-parallel-collections/issues/22)
private[internal] object CompatParColls {
Comment on lines +3 to +5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code already exists in sbt, but is not public https://github.com/sbt/sbt/search?q=CollectionConverters

val Converters = {
import Compat._

{
import scala.collection.parallel._

CollectionConverters
}
}

object Compat {
object CollectionConverters
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import coursier.maven.MavenAttributes
import coursier.util.Artifact
import sbt.librarymanagement.{Artifact => _, Configuration => _, _}
import sbt.util.Logger
import CompatParColls.Converters._

private[internal] object SbtUpdateReport {

Expand Down Expand Up @@ -303,7 +304,7 @@ private[internal] object SbtUpdateReport {
classLoaders: Seq[ClassLoader],
): UpdateReport = {

val configReports = resolutions.map {
val configReports = resolutions.par.map {
case (config, subRes) =>

val reports = moduleReports(
Expand Down