mirror of https://github.com/sbt/sbt.git
spawn new instance of Ivy during minigraph resolution
This commit is contained in:
parent
07b696b395
commit
04499b98ff
|
|
@ -98,6 +98,7 @@ final class IvySbt(val configuration: IvyConfiguration) {
|
||||||
setResolveEngine(new ResolveEngine(getSettings, getEventManager, getSortEngine) with CachedResolutionResolveEngine {
|
setResolveEngine(new ResolveEngine(getSettings, getEventManager, getSortEngine) with CachedResolutionResolveEngine {
|
||||||
val cachedResolutionResolveCache = IvySbt.cachedResolutionResolveCache
|
val cachedResolutionResolveCache = IvySbt.cachedResolutionResolveCache
|
||||||
val projectResolver = prOpt
|
val projectResolver = prOpt
|
||||||
|
def makeInstance = mkIvy
|
||||||
})
|
})
|
||||||
} else setResolveEngine(new ResolveEngine(getSettings, getEventManager, getSortEngine))
|
} else setResolveEngine(new ResolveEngine(getSettings, getEventManager, getSortEngine))
|
||||||
super.bind()
|
super.bind()
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import java.net.URL
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import collection.concurrent
|
import collection.concurrent
|
||||||
import collection.immutable.ListMap
|
import collection.immutable.ListMap
|
||||||
|
import org.apache.ivy.Ivy
|
||||||
import org.apache.ivy.core
|
import org.apache.ivy.core
|
||||||
import core.resolve._
|
import core.resolve._
|
||||||
import core.module.id.{ ModuleRevisionId, ModuleId => IvyModuleId }
|
import core.module.id.{ ModuleRevisionId, ModuleId => IvyModuleId }
|
||||||
|
|
@ -260,6 +261,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
||||||
|
|
||||||
private[sbt] def cachedResolutionResolveCache: CachedResolutionResolveCache
|
private[sbt] def cachedResolutionResolveCache: CachedResolutionResolveCache
|
||||||
private[sbt] def projectResolver: Option[ProjectResolver]
|
private[sbt] def projectResolver: Option[ProjectResolver]
|
||||||
|
private[sbt] def makeInstance: Ivy
|
||||||
|
|
||||||
// Return sbt's UpdateReport.
|
// Return sbt's UpdateReport.
|
||||||
def customResolve(md0: ModuleDescriptor, logicalClock: LogicalClock, options0: ResolveOptions, depDir: File, log: Logger): Either[ResolveException, UpdateReport] = {
|
def customResolve(md0: ModuleDescriptor, logicalClock: LogicalClock, options0: ResolveOptions, depDir: File, log: Logger): Either[ResolveException, UpdateReport] = {
|
||||||
|
|
@ -271,7 +273,8 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
||||||
def doWork(md: ModuleDescriptor): Either[ResolveException, UpdateReport] =
|
def doWork(md: ModuleDescriptor): Either[ResolveException, UpdateReport] =
|
||||||
{
|
{
|
||||||
val options1 = new ResolveOptions(options0)
|
val options1 = new ResolveOptions(options0)
|
||||||
var rr = super.resolve(md, options1)
|
val i = makeInstance
|
||||||
|
var rr = i.resolve(md, options1)
|
||||||
if (!rr.hasError) Right(IvyRetrieve.updateReport(rr, cachedDescriptor))
|
if (!rr.hasError) Right(IvyRetrieve.updateReport(rr, cachedDescriptor))
|
||||||
else {
|
else {
|
||||||
val messages = rr.getAllProblemMessages.toArray.map(_.toString).distinct
|
val messages = rr.getAllProblemMessages.toArray.map(_.toString).distinct
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue