Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion backend/src/main/scala/bloop/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import sbt.internal.inc.bloop.internal.BloopStamps
import sbt.util.InterfaceUtil
import xsbti.T2
import xsbti.VirtualFileRef
import xsbti.compile._
import xsbti.compile.{CompilerCache => _, ScalaInstance => _, _}

case class CompileInputs(
scalaInstance: ScalaInstance,
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/scala/bloop/reporter/Reporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ object Reporter {
override def reverse: Buffer[A] = {
val reversed = mutable.Stack.empty[A]
weakIterator.foreach(reversed.push)
newBuffer(reversed: _*)
newBuffer(reversed.toSeq: _*)
}
override def toList: List[A] = weakIterator.toList
override def toArray[B >: A: ClassTag]: Array[B] = weakIterator.toArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ final class BloopAnalysisCallback(
override def isPickleJava(): Boolean = false
override def getPickleJarPair(): ju.Optional[T2[Path, Path]] = ju.Optional.empty()

def getOrNil[A, B](m: collection.Map[A, Seq[B]], a: A): Seq[B] = m.get(a).toList.flatten
def getOrNil[A, B](m: collection.Map[A, mutable.ListBuffer[B]], a: A): Seq[B] =
m.get(a).toList.flatten
def addCompilation(base: Analysis): Analysis =
base.copy(compilations = base.compilations.add(compilation))
def addUsedNames(base: Analysis): Analysis = usedNames.foldLeft(base) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ final class ConcurrentAnalysisCallback(
override def isPickleJava(): Boolean = false
override def getPickleJarPair(): ju.Optional[T2[Path, Path]] = ju.Optional.empty()

def getOrNil[A, B](m: collection.Map[A, Seq[B]], a: A): Seq[B] = m.get(a).toList.flatten
def getOrNil[A, B](m: collection.Map[A, ConcurrentLinkedQueue[B]], a: A): Seq[B] = {
import scala.collection.JavaConverters._
m.get(a).map(_.asScala.toList).getOrElse(Nil)
}
def addCompilation(base: Analysis): Analysis =
base.copy(compilations = base.compilations.add(compilation))
def addUsedNames(base: Analysis): Analysis = usedNames.foldLeft(base) {
Expand Down Expand Up @@ -379,9 +382,9 @@ final class ConcurrentAnalysisCallback(
.map(_._1)
val analyzedApis = classesInSrc.map(analyzeClass)
val info = SourceInfos.makeInfo(
getOrNil(reportedProblems.mapValues { _.asScala.toSeq }, src),
getOrNil(unreportedProblems.mapValues { _.asScala.toSeq }, src),
getOrNil(mainClasses.mapValues { _.asScala.toSeq }, src)
getOrNil(reportedProblems, src),
getOrNil(unreportedProblems, src),
getOrNil(mainClasses, src)
)
val binaries = binaryDeps.getOrElse(src, ConcurrentHashMap.newKeySet[Path]).asScala
val localProds = localClasses
Expand Down
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ lazy val frontend: Project = project
"jsBridge1" -> (jsBridge1Name + "_" + Keys.scalaBinaryVersion.value),
"snailgunVersion" -> Dependencies.snailgunVersion
),
libraryDependencySchemes += "org.scala-lang.modules" %% "scala-parallel-collections" % "always",
(run / javaOptions) ++= jvmOptions,
(Test / javaOptions) ++= jvmOptions,
tmpDirSettings,
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/main/scala/bloop/dap/BloopDebuggee.scala
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ object BloopDebuggeeRunner {
val classDir = client.getUniqueClassesDirFor(project, forceGeneration = true)
val projectName = project.bspUri.toString
val scalaVersion = project.scalaInstance.map(si => ScalaVersion(si.version))
Module(projectName, scalaVersion, project.scalacOptions, classDir.underlying, sourceBuffer)
Module(
projectName,
scalaVersion,
project.scalacOptions,
classDir.underlying,
sourceBuffer.toSeq
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ final case class ResultsCache private (
Paths.delete(path)
}
// Remove all the successful results from the cache.
val newSuccessful = successful.filterKeys(p => !projects.contains(p))
val newAll = all.filterKeys(p => !projects.contains(p))
val newSuccessful = successful.filterKeys(p => !projects.contains(p)).toMap
val newAll = all.filterKeys(p => !projects.contains(p)).toMap
val deleteClassesDirs = successful.filterKeys(projects.contains).flatMap {
case (project, result) =>
List(
Expand Down
31 changes: 17 additions & 14 deletions frontend/src/main/scala/bloop/engine/tasks/TestTask.scala
Original file line number Diff line number Diff line change
Expand Up @@ -320,21 +320,24 @@ object TestTask {
// usually it is a Array(new SuiteSelector). However, if only subset of test are supposed to
// be run, then it can be altered to Array[TestSelector]
val selectedTests = testClasses.suites.map(entry => (entry.className, entry.tests)).toMap
includedTests.groupBy(_.framework).mapValues { taskDefs =>
taskDefs.map {
case TaskDefWithFramework(taskDef, _) =>
selectedTests.get(taskDef.fullyQualifiedName()).getOrElse(Nil) match {
case Nil => taskDef
case selectedTests =>
new TaskDef(
taskDef.fullyQualifiedName(),
taskDef.fingerprint(),
false,
selectedTests.map(test => new TestSelector(test)).toList.toArray
)
}
includedTests
.groupBy(_.framework)
.mapValues { taskDefs =>
taskDefs.map {
case TaskDefWithFramework(taskDef, _) =>
selectedTests.get(taskDef.fullyQualifiedName()).getOrElse(Nil) match {
case Nil => taskDef
case selectedTests =>
new TaskDef(
taskDef.fullyQualifiedName(),
taskDef.fingerprint(),
false,
selectedTests.map(test => new TestSelector(test)).toList.toArray
)
}
}
}
}
.toMap
}

private[bloop] def discoverTests(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ object CompileDependenciesData {
val newExistingResources =
existingResources.filterNot(r => addedResources.contains(r))
newExistingResources.foreach(r => addedResources.add(r))
newExistingResources ++ classesDirs
case None => classesDirs
(newExistingResources ++ classesDirs).toSeq
case None => classesDirs.toSeq
}
case None => List(entry)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@ object CommandsDocGenerator {
}
}

parsed.map(_.groupBy(_.projectName).mapValues(_.flatMap(_.examples)))
parsed.map(_.groupBy(_.projectName).mapValues(_.flatMap(_.examples)).toMap)
}
}
2 changes: 1 addition & 1 deletion frontend/src/test/scala/bloop/BloopLoggerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,6 @@ class BloopLoggerSpec {
buffer += current
}

buffer
buffer.toSeq
}
}
12 changes: 6 additions & 6 deletions frontend/src/test/scala/bloop/testing/DiffAssertions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ object DiffAssertions {
case ex: Exception =>
if (print) {
obtained.linesIterator.toList match {
case head +: tail =>
case head :: Nil =>
println(head)
case head :: tail =>
val b = new StringBuilder()
b.++=(" \"\"\"|" + head).++=(System.lineSeparator())
tail.foreach { line =>
Expand All @@ -45,8 +47,6 @@ object DiffAssertions {
}
b.++=(" |\"\"\".stripMargin").++=(System.lineSeparator())
println(b.mkString)
case head +: Nil =>
println(head)
case Nil =>
println("obtained is empty")
}
Expand Down Expand Up @@ -131,11 +131,11 @@ object DiffAssertions {
catch {
case ex: Exception =>
obtained.linesIterator.toList match {
case head +: tail =>
case head :: Nil =>
println(head)
case head :: tail =>
println(" \"\"\"|" + head)
tail.foreach(line => println(" |" + line))
case head +: Nil =>
println(head)
case Nil =>
println("obtained is empty")
}
Expand Down
3 changes: 2 additions & 1 deletion project/BuildPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ object BuildImplementation {
final val buildSettings: Seq[Def.Setting[_]] = Seq(
Keys.organization := "io.github.alexarchambault.bleep",
Keys.updateOptions := Keys.updateOptions.value.withCachedResolution(true),
Keys.scalaVersion := Dependencies.Scala212Version,
Keys.scalaVersion := Dependencies.Scala213Version,
Keys.crossScalaVersions := Seq(Dependencies.Scala212Version, Dependencies.Scala213Version),
Keys.homepage := Some(ThisRepo),
Keys.licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
Keys.developers := List(
Expand Down