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.
This commit is contained in:
tanishiking24 2018-05-17 10:46:21 +09:00
parent 4106b37709
commit c24ab5c4ee
2 changed files with 2 additions and 2 deletions

View File

@ -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())
}

View File

@ -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