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 c703b2a6a0
4 changed files with 13 additions and 4 deletions

View File

@ -27,7 +27,7 @@ private[sbt] object CachedResolutionResolveCache {
def createID(organization: String, name: String, revision: String) = def createID(organization: String, name: String, revision: String) =
ModuleRevisionId.newInstance(organization, name, revision) ModuleRevisionId.newInstance(organization, name, revision)
def sbtOrgTemp = JsonUtil.sbtOrgTemp def sbtOrgTemp = JsonUtil.sbtOrgTemp
def graphVersion = "0.13.9B" def graphVersion = "0.13.9C"
val buildStartup: Long = System.currentTimeMillis val buildStartup: Long = System.currentTimeMillis
lazy val todayStr: String = toYyyymmdd(buildStartup) lazy val todayStr: String = toYyyymmdd(buildStartup)
lazy val tomorrowStr: String = toYyyymmdd(buildStartup + (1 day).toMillis) 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 = { def mergeModuleReports(org: String, name: String, version: String, xs: Seq[ModuleReport]): ModuleReport = {
val completelyEvicted = xs forall { _.evicted } val completelyEvicted = xs forall { _.evicted }
val allCallers = xs flatMap { _.callers } 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 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 { val merged = (modules groupBy { m => (m.module.organization, m.module.name, m.module.revision) }).toSeq.toVector flatMap {
case ((org, name, version), xs) => 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) IvyActions.updateEither(module, config, UnresolvedWarningConfiguration(), LogicalClock.unknown, Some(currentDependency), log)
} }
def cleanIvyCache: Unit =
{
IO.delete(currentTarget / "cache")
}
def cleanCachedResolutionCache(module: IvySbt#Module): Unit = def cleanCachedResolutionCache(module: IvySbt#Module): Unit =
{ {
IvyActions.cleanCachedResolutionCache(module, log) IvyActions.cleanCachedResolutionCache(module, log)

View File

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

View File

@ -119,7 +119,7 @@ On a larger dependency graph, the JSON file growing to be 100MB+
with 97% of taken up by *caller* information. with 97% of taken up by *caller* information.
To make the matter worse, these large JSON files were never cleaned up. To make the matter worse, these large JSON files were never cleaned up.
sbt 0.13.9 filters out artificial callers, sbt 0.13.9 filters out artificial or duplicate callers,
which fixes `OutOfMemoryException` seen on some builds. which fixes `OutOfMemoryException` seen on some builds.
This generally shrinks the size of JSON, so it should make the IO operations faster. This generally shrinks the size of JSON, so it should make the IO operations faster.
Dynamic graphs will be rotated with directories named after `yyyy-mm-dd`, Dynamic graphs will be rotated with directories named after `yyyy-mm-dd`,