@@ -116,7 +116,11 @@ object BloopComponentCompiler {
116116 */
117117 private def compiledBridge (bridgeSources : ModuleID , scalaInstance : ScalaInstance ): File = {
118118 val raw = new RawCompiler (scalaInstance, ClasspathOptionsUtil .auto, logger)
119- val zinc = new BloopComponentCompiler (raw, manager, bridgeSources, logger)
119+ val bridgeJarsOpt = scalaInstance match {
120+ case b : _root_.bloop.ScalaInstance => b.bridgeJarsOpt
121+ case _ => None
122+ }
123+ val zinc = new BloopComponentCompiler (raw, manager, bridgeSources, bridgeJarsOpt, logger)
120124 logger.debug(s " Getting $bridgeSources for Scala ${scalaInstance.version}" )(
121125 DebugFilter .Compilation
122126 )
@@ -229,6 +233,7 @@ private[inc] class BloopComponentCompiler(
229233 compiler : RawCompiler ,
230234 manager : BloopComponentManager ,
231235 bridgeSources : ModuleID ,
236+ bridgeJarsOpt : Option [Seq [File ]],
232237 logger : BloopLogger
233238) {
234239 implicit val debugFilter : DebugFilter .Compilation .type = DebugFilter .Compilation
@@ -257,23 +262,25 @@ private[inc] class BloopComponentCompiler(
257262 IO .withTemporaryDirectory { _ =>
258263 val shouldResolveSources =
259264 bridgeSources.explicitArtifacts.exists(_.`type` == " src" )
260- val allArtifacts = BloopDependencyResolution .resolveWithErrors(
261- List (
262- BloopDependencyResolution
263- .Artifact (bridgeSources.organization, bridgeSources.name, bridgeSources.revision)
264- ),
265- logger,
266- resolveSources = shouldResolveSources,
267- List (
268- coursierapi.MavenRepository .of(
269- " https://scala-ci.typesafe.com/artifactory/scala-integration/"
265+ val allArtifacts = bridgeJarsOpt.map(_.map(_.toPath)).getOrElse {
266+ BloopDependencyResolution .resolveWithErrors(
267+ List (
268+ BloopDependencyResolution
269+ .Artifact (bridgeSources.organization, bridgeSources.name, bridgeSources.revision)
270+ ),
271+ logger,
272+ resolveSources = shouldResolveSources,
273+ List (
274+ coursierapi.MavenRepository .of(
275+ " https://scala-ci.typesafe.com/artifactory/scala-integration/"
276+ )
270277 )
271- )
272- ) match {
273- case Right (paths ) => paths.map(_.underlying).toVector
274- case Left (t) =>
275- val msg = s " Couldn't retrieve module $bridgeSources "
276- throw new InvalidComponent (msg, t)
278+ ) match {
279+ case Right (paths) => paths.map(_.underlying).toVector
280+ case Left (t ) =>
281+ val msg = s " Couldn't retrieve module $bridgeSources "
282+ throw new InvalidComponent (msg, t)
283+ }
277284 }
278285
279286 if (! shouldResolveSources) {
@@ -286,7 +293,7 @@ private[inc] class BloopComponentCompiler(
286293 if (! HydraSupport .isEnabled(compiler.scalaInstance)) (bridgeSources.name, sources)
287294 else {
288295 val hydraBridgeModule = HydraSupport .getModuleForBridgeSources(compiler.scalaInstance)
289- mergeBloopAndHydraBridges(sources, hydraBridgeModule) match {
296+ mergeBloopAndHydraBridges(sources.toVector , hydraBridgeModule) match {
290297 case Right (mergedHydraBridgeSourceJar) =>
291298 (hydraBridgeModule.name, mergedHydraBridgeSourceJar)
292299 case Left (error) =>
0 commit comments