Skip to content

Commit bd63a9d

Browse files
Cross-compile things with 2.13
1 parent 3180fdb commit bd63a9d

File tree

13 files changed

+27
-22
lines changed

13 files changed

+27
-22
lines changed

backend/src/main/scala/bloop/Compiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import sbt.internal.inc.bloop.internal.BloopStamps
3737
import sbt.util.InterfaceUtil
3838
import xsbti.T2
3939
import xsbti.VirtualFileRef
40-
import xsbti.compile._
40+
import xsbti.compile.{CompilerCache => _, ScalaInstance => _, _}
4141

4242
case class CompileInputs(
4343
scalaInstance: ScalaInstance,

backend/src/main/scala/bloop/reporter/Reporter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ object Reporter {
364364
override def reverse: Buffer[A] = {
365365
val reversed = mutable.Stack.empty[A]
366366
weakIterator.foreach(reversed.push)
367-
newBuffer(reversed: _*)
367+
newBuffer(reversed.toSeq: _*)
368368
}
369369
override def toList: List[A] = weakIterator.toList
370370
override def toArray[B >: A: ClassTag]: Array[B] = weakIterator.toArray

backend/src/main/scala/sbt/internal/inc/bloop/internal/BloopAnalysisCallback.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ final class BloopAnalysisCallback(
320320
override def isPickleJava(): Boolean = false
321321
override def getPickleJarPair(): ju.Optional[T2[Path, Path]] = ju.Optional.empty()
322322

323-
def getOrNil[A, B](m: collection.Map[A, Seq[B]], a: A): Seq[B] = m.get(a).toList.flatten
323+
def getOrNil[A, B](m: collection.Map[A, mutable.ListBuffer[B]], a: A): Seq[B] = m.get(a).toList.flatten
324324
def addCompilation(base: Analysis): Analysis =
325325
base.copy(compilations = base.compilations.add(compilation))
326326
def addUsedNames(base: Analysis): Analysis = usedNames.foldLeft(base) {

backend/src/main/scala/sbt/internal/inc/bloop/internal/ConcurrentAnalysisCallback.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ final class ConcurrentAnalysisCallback(
313313
override def isPickleJava(): Boolean = false
314314
override def getPickleJarPair(): ju.Optional[T2[Path, Path]] = ju.Optional.empty()
315315

316-
def getOrNil[A, B](m: collection.Map[A, Seq[B]], a: A): Seq[B] = m.get(a).toList.flatten
316+
def getOrNil[A, B](m: collection.Map[A, ConcurrentLinkedQueue[B]], a: A): Seq[B] = {
317+
import scala.collection.JavaConverters._
318+
m.get(a).map(_.asScala.toList).getOrElse(Nil)
319+
}
317320
def addCompilation(base: Analysis): Analysis =
318321
base.copy(compilations = base.compilations.add(compilation))
319322
def addUsedNames(base: Analysis): Analysis = usedNames.foldLeft(base) {
@@ -379,9 +382,9 @@ final class ConcurrentAnalysisCallback(
379382
.map(_._1)
380383
val analyzedApis = classesInSrc.map(analyzeClass)
381384
val info = SourceInfos.makeInfo(
382-
getOrNil(reportedProblems.mapValues { _.asScala.toSeq }, src),
383-
getOrNil(unreportedProblems.mapValues { _.asScala.toSeq }, src),
384-
getOrNil(mainClasses.mapValues { _.asScala.toSeq }, src)
385+
getOrNil(reportedProblems, src),
386+
getOrNil(unreportedProblems, src),
387+
getOrNil(mainClasses, src)
385388
)
386389
val binaries = binaryDeps.getOrElse(src, ConcurrentHashMap.newKeySet[Path]).asScala
387390
val localProds = localClasses

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ lazy val frontend: Project = project
158158
"jsBridge1" -> (jsBridge1Name + "_" + Keys.scalaBinaryVersion.value),
159159
"snailgunVersion" -> Dependencies.snailgunVersion
160160
),
161+
libraryDependencySchemes += "org.scala-lang.modules" %% "scala-parallel-collections" % "always",
161162
(run / javaOptions) ++= jvmOptions,
162163
(Test / javaOptions) ++= jvmOptions,
163164
tmpDirSettings,

frontend/src/main/scala/bloop/dap/BloopDebuggee.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ object BloopDebuggeeRunner {
306306
val classDir = client.getUniqueClassesDirFor(project, forceGeneration = true)
307307
val projectName = project.bspUri.toString
308308
val scalaVersion = project.scalaInstance.map(si => ScalaVersion(si.version))
309-
Module(projectName, scalaVersion, project.scalacOptions, classDir.underlying, sourceBuffer)
309+
Module(projectName, scalaVersion, project.scalacOptions, classDir.underlying, sourceBuffer.toSeq)
310310
}
311311
}
312312
}

frontend/src/main/scala/bloop/engine/caches/ResultsCache.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ final case class ResultsCache private (
8383
Paths.delete(path)
8484
}
8585
// Remove all the successful results from the cache.
86-
val newSuccessful = successful.filterKeys(p => !projects.contains(p))
87-
val newAll = all.filterKeys(p => !projects.contains(p))
86+
val newSuccessful = successful.filterKeys(p => !projects.contains(p)).toMap
87+
val newAll = all.filterKeys(p => !projects.contains(p)).toMap
8888
val deleteClassesDirs = successful.filterKeys(projects.contains).flatMap {
8989
case (project, result) =>
9090
List(

frontend/src/main/scala/bloop/engine/tasks/TestTask.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ object TestTask {
334334
)
335335
}
336336
}
337-
}
337+
}.toMap
338338
}
339339

340340
private[bloop] def discoverTests(

frontend/src/main/scala/bloop/engine/tasks/compilation/CompileDependenciesData.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ object CompileDependenciesData {
7474
val newExistingResources =
7575
existingResources.filterNot(r => addedResources.contains(r))
7676
newExistingResources.foreach(r => addedResources.add(r))
77-
newExistingResources ++ classesDirs
78-
case None => classesDirs
77+
(newExistingResources ++ classesDirs).toSeq
78+
case None => classesDirs.toSeq
7979
}
8080
case None => List(entry)
8181
}

frontend/src/main/scala/bloop/util/CommandsDocGenerator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,6 @@ object CommandsDocGenerator {
185185
}
186186
}
187187

188-
parsed.map(_.groupBy(_.projectName).mapValues(_.flatMap(_.examples)))
188+
parsed.map(_.groupBy(_.projectName).mapValues(_.flatMap(_.examples)).toMap)
189189
}
190190
}

0 commit comments

Comments
 (0)