From c24ab5c4eeac5032677ce2672c508808e695f175 Mon Sep 17 00:00:00 2001 From: tanishiking24 Date: Thu, 17 May 2018 10:46:21 +0900 Subject: [PATCH] Enable sbt to specify config.resource without disabling gigahorse Fix https://github.com/sbt/sbt/issues/3585. Gigahorse.config tries to load specified config file in sbt's classpath and of course fail to find the specified config file, and throw java.io.IOException if we specify config.resource, because We can avoid trying to load specified config file inside sbt by avoid using Gigahorse.config that call `ConfigFactory.load()` inside. This commit fixes librarymanagement not to use Gigahorse.config and make it use gigahorse.Config() which returns gigahorse's default config without calling `ConfigFactory.load()` instead. --- core/src/main/scala/sbt/librarymanagement/Http.scala | 2 +- .../internal/librarymanagement/ivyint/GigahorseUrlHandler.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/sbt/librarymanagement/Http.scala b/core/src/main/scala/sbt/librarymanagement/Http.scala index 9870d9b0f..833a9edc0 100644 --- a/core/src/main/scala/sbt/librarymanagement/Http.scala +++ b/core/src/main/scala/sbt/librarymanagement/Http.scala @@ -3,5 +3,5 @@ package sbt.librarymanagement import gigahorse._, support.okhttp.Gigahorse object Http { - lazy val http: HttpClient = Gigahorse.http(Gigahorse.config) + lazy val http: HttpClient = Gigahorse.http(gigahorse.Config()) } diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala index b7e754dda..49b0f2bbc 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala @@ -214,7 +214,7 @@ object GigahorseUrlHandler { private val EmptyBuffer: Array[Byte] = new Array[Byte](0) - lazy val http: HttpClient = Gigahorse.http(Gigahorse.config) + lazy val http: HttpClient = Gigahorse.http(gigahorse.Config()) private lazy val okHttpClient: OkHttpClient = { http