Skip to content

Commit

Permalink
Merge pull request #152 from tgodzik/update-fork
Browse files Browse the repository at this point in the history
Update fork with newest changes
  • Loading branch information
tgodzik committed Sep 4, 2023
2 parents 5220768 + 52067ab commit 20f07dd
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.11"
version = "3.7.14"

align.preset = more
maxColumn = 100
Expand Down
8 changes: 6 additions & 2 deletions backend/src/main/scala/bloop/ScalaInstance.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import bloop.internal.build.BloopScalaInfo
import bloop.logging.DebugFilter
import bloop.logging.Logger

import coursierapi.Repository

final class ScalaInstance private (
val organization: String,
val name: String,
Expand Down Expand Up @@ -195,12 +197,14 @@ object ScalaInstance {
scalaOrg: String,
scalaName: String,
scalaVersion: String,
logger: Logger
logger: Logger,
additionalRepositories: List[Repository] = Nil
): ScalaInstance = {
def resolveInstance: ScalaInstance = {
val allPaths = DependencyResolution.resolve(
List(DependencyResolution.Artifact(scalaOrg, scalaName, scalaVersion)),
logger
logger,
additionalRepos = additionalRepositories
)
val allJars = allPaths.collect {
case path if path.underlying.toString.endsWith(".jar") => path.underlying.toFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import xsbti.ComponentProvider
import xsbti.Logger
import xsbti.compile.ClasspathOptionsUtil
import xsbti.compile.CompilerBridgeProvider
import scala.util.control.NonFatal

object BloopComponentCompiler {
import xsbti.compile.ScalaInstance
Expand All @@ -44,11 +45,22 @@ object BloopComponentCompiler {

private val CompileConf = Some(Configurations.Compile.name)
def getModuleForBridgeSources(scalaInstance: ScalaInstance): ModuleID = {
val isAfter2_13_11 =
try {
val Array(_, _, patch) = scalaInstance.version().split("\\.")
val patchTrimmed = patch.takeWhile(_.isDigit).toInt
scalaInstance.version().startsWith("2.13.") && patchTrimmed >= 12
} catch {
case NonFatal(_) => false
}

def compilerBridgeId(scalaVersion: String) = {

// Defaults to bridge for 2.13 for Scala versions bigger than 2.13.x
scalaVersion match {
case sc if (sc startsWith "0.") => "dotty-sbt-bridge"
case sc if (sc startsWith "3.") => "scala3-sbt-bridge"
case _ if isAfter2_13_11 => "scala2-sbt-bridge"
case sc if (sc startsWith "2.10.") => "compiler-bridge_2.10"
case sc if (sc startsWith "2.11.") => "compiler-bridge_2.11"
case sc if (sc startsWith "2.12.") => "compiler-bridge_2.12"
Expand All @@ -57,7 +69,7 @@ object BloopComponentCompiler {
}

val (isDotty, organization, version) = scalaInstance match {
case instance: BloopScalaInstance if instance.isDotty =>
case instance: BloopScalaInstance if instance.isDotty || isAfter2_13_11 =>
(true, instance.organization, instance.version)
case _ => (false, "org.scala-sbt", latestVersion)
}
Expand Down Expand Up @@ -250,7 +262,12 @@ private[inc] class BloopComponentCompiler(
.Artifact(bridgeSources.organization, bridgeSources.name, bridgeSources.revision)
),
logger,
resolveSources = shouldResolveSources
resolveSources = shouldResolveSources,
List(
coursierapi.MavenRepository.of(
"https://scala-ci.typesafe.com/artifactory/scala-integration/"
)
)
) match {
case Right(paths) => paths.map(_.underlying).toVector
case Left(t) =>
Expand Down
8 changes: 4 additions & 4 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object Dependencies {
ivy"com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:$jsoniterVersion"
def junit = ivy"com.github.sbt:junit-interface:0.13.3"
def libdaemonjvm = ivy"io.github.alexarchambault.libdaemon::libdaemon:0.0.11"
def libraryManagement = ivy"org.scala-sbt::librarymanagement-ivy:1.9.1"
def libraryManagement = ivy"org.scala-sbt::librarymanagement-ivy:1.9.2"
def log4j = ivy"org.apache.logging.log4j:log4j-core:2.20.0"
def logback = ivy"ch.qos.logback:logback-classic:1.4.6"
def macroParadise = ivy"org.scalamacros:::paradise:2.1.1"
Expand All @@ -57,9 +57,9 @@ object Dependencies {
def nailgun = ivy"io.github.alexarchambault.bleep:nailgun-server:1.0.7"
def osLib = ivy"com.lihaoyi::os-lib:0.9.0"
def pprint = ivy"com.lihaoyi::pprint:0.8.1"
def sbtTestAgent = ivy"org.scala-sbt:test-agent:1.9.3"
def sbtTestAgent = ivy"org.scala-sbt:test-agent:1.9.4"
def sbtTestInterface = ivy"org.scala-sbt:test-interface:1.0"
def scalaDebugAdapter = ivy"ch.epfl.scala::scala-debug-adapter:3.1.3"
def scalaDebugAdapter = ivy"ch.epfl.scala::scala-debug-adapter:3.1.4"
def scalaJsLinker1 = ivy"org.scala-js::scalajs-linker:$scalaJs1Version"
def scalaJsEnvs1 = ivy"org.scala-js::scalajs-js-envs:$scalaJsEnvsVersion"
def scalaJsEnvNode1 = ivy"org.scala-js::scalajs-env-nodejs:$scalaJsEnvsVersion"
Expand All @@ -75,7 +75,7 @@ object Dependencies {
def xxHashLibrary = ivy"net.jpountz.lz4:lz4:1.3.0"
def zinc = ivy"org.scala-sbt::zinc:1.9.3"
def zipkinSender = ivy"io.zipkin.reporter2:zipkin-sender-urlconnection:2.16.4"
def zt = ivy"org.zeroturnaround:zt-zip:1.15"
def zt = ivy"org.zeroturnaround:zt-zip:1.16"

def graalVmId = s"graalvm-java17:$graalvmVersion"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sbt.version=1.9.3
sbt.version=1.9.4

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sbt.version=1.9.3
sbt.version=1.9.4

Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
15 changes: 13 additions & 2 deletions frontend/src/test/scala/bloop/ScalaVersionsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import bloop.task.Task
import bloop.util.TestProject
import bloop.util.TestUtil

import coursierapi.MavenRepository

object ScalaVersionsSpec extends bloop.testing.BaseSuite {
var loggers: List[RecordingLogger] = Nil

Expand All @@ -22,7 +24,15 @@ object ScalaVersionsSpec extends bloop.testing.BaseSuite {

def jarsForScalaVersion(version: String, logger: RecordingLogger) = {
ScalaInstance
.resolve(compilerOrg, compilerArtifact, version, logger)
.resolve(
compilerOrg,
compilerArtifact,
version,
logger,
List(
MavenRepository.of("https://scala-ci.typesafe.com/artifactory/scala-integration/")
)
)
.allJars
.map(AbsolutePath(_))
}
Expand Down Expand Up @@ -66,7 +76,8 @@ object ScalaVersionsSpec extends bloop.testing.BaseSuite {
"2.12.17",
"2.13.10",
"3.1.3",
"3.2.1"
"3.2.1",
"2.13.12-bin-86f40c2"
)

val allVersions = scalaVersions
Expand Down

0 comments on commit 20f07dd

Please sign in to comment.