@@ -116,7 +116,11 @@ object BloopComponentCompiler {
116
116
*/
117
117
private def compiledBridge (bridgeSources : ModuleID , scalaInstance : ScalaInstance ): File = {
118
118
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)
120
124
logger.debug(s " Getting $bridgeSources for Scala ${scalaInstance.version}" )(
121
125
DebugFilter .Compilation
122
126
)
@@ -229,6 +233,7 @@ private[inc] class BloopComponentCompiler(
229
233
compiler : RawCompiler ,
230
234
manager : BloopComponentManager ,
231
235
bridgeSources : ModuleID ,
236
+ bridgeJarsOpt : Option [Seq [File ]],
232
237
logger : BloopLogger
233
238
) {
234
239
implicit val debugFilter : DebugFilter .Compilation .type = DebugFilter .Compilation
@@ -257,23 +262,25 @@ private[inc] class BloopComponentCompiler(
257
262
IO .withTemporaryDirectory { _ =>
258
263
val shouldResolveSources =
259
264
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
+ )
270
277
)
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
+ }
277
284
}
278
285
279
286
if (! shouldResolveSources) {
@@ -286,7 +293,7 @@ private[inc] class BloopComponentCompiler(
286
293
if (! HydraSupport .isEnabled(compiler.scalaInstance)) (bridgeSources.name, sources)
287
294
else {
288
295
val hydraBridgeModule = HydraSupport .getModuleForBridgeSources(compiler.scalaInstance)
289
- mergeBloopAndHydraBridges(sources, hydraBridgeModule) match {
296
+ mergeBloopAndHydraBridges(sources.toVector , hydraBridgeModule) match {
290
297
case Right (mergedHydraBridgeSourceJar) =>
291
298
(hydraBridgeModule.name, mergedHydraBridgeSourceJar)
292
299
case Left (error) =>
0 commit comments