Merge pull request #2116 from sbt/0.13.9

Merge 0.13.9 back into 0.13
This commit is contained in:
eugene yokota 2015-07-18 13:36:04 -04:00
commit c8e1da38b7
3 changed files with 12 additions and 3 deletions

View File

@ -27,7 +27,7 @@ private[sbt] object CachedResolutionResolveCache {
def createID(organization: String, name: String, revision: String) =
ModuleRevisionId.newInstance(organization, name, revision)
def sbtOrgTemp = JsonUtil.sbtOrgTemp
def graphVersion = "0.13.9B"
def graphVersion = "0.13.9C"
val buildStartup: Long = System.currentTimeMillis
lazy val todayStr: String = toYyyymmdd(buildStartup)
lazy val tomorrowStr: String = toYyyymmdd(buildStartup + (1 day).toMillis)
@ -470,8 +470,10 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
def mergeModuleReports(org: String, name: String, version: String, xs: Seq[ModuleReport]): ModuleReport = {
val completelyEvicted = xs forall { _.evicted }
val allCallers = xs flatMap { _.callers }
// Caller info is often repeated across the subprojects. We only need ModuleID info for later, so xs.head is ok.
val distinctByModuleId = allCallers.groupBy({ _.caller }).toList map { case (k, xs) => xs.head }
val allArtifacts = (xs flatMap { _.artifacts }).distinct
xs.head.copy(artifacts = allArtifacts, evicted = completelyEvicted, callers = allCallers)
xs.head.copy(artifacts = allArtifacts, evicted = completelyEvicted, callers = distinctByModuleId)
}
val merged = (modules groupBy { m => (m.module.organization, m.module.name, m.module.revision) }).toSeq.toVector flatMap {
case ((org, name, version), xs) =>

View File

@ -59,6 +59,11 @@ trait BaseIvySpecification extends Specification {
IvyActions.updateEither(module, config, UnresolvedWarningConfiguration(), LogicalClock.unknown, Some(currentDependency), log)
}
def cleanIvyCache: Unit =
{
IO.delete(currentTarget / "cache")
}
def cleanCachedResolutionCache(module: IvySbt#Module): Unit =
{
IvyActions.cleanCachedResolutionCache(module, log)

View File

@ -28,6 +28,7 @@ class CachedResolutionSpec extends BaseIvySpecification {
import ShowLines._
def e1 = {
cleanIvyCache
val m = module(ModuleID("com.example", "foo", "0.1.0", Some("compile")),
Seq(commonsIo13), Some("2.10.2"), UpdateOptions().withCachedResolution(true))
val report = ivyUpdate(m)
@ -65,7 +66,8 @@ class CachedResolutionSpec extends BaseIvySpecification {
// avro:1.4.0 will be evicted by avro:1.7.7.
// #2046 says that netty:3.2.0.Final is incorrectly evicted by netty:3.2.1.Final
def e3 = {
log.setLevel(Level.Debug)
// log.setLevel(Level.Debug)
cleanIvyCache
val m = module(ModuleID("com.example", "foo", "0.3.0", Some("compile")),
Seq(avro177, dataAvro1940, netty320),
Some("2.10.2"), UpdateOptions().withCachedResolution(true))