Permalink
Browse files

Fix compilation error for 2.10.0-M5 for all but main project.

  • Loading branch information...
1 parent 5297daf commit ed9ea1cf772a1008a144e6b0ca8548eb90c292a7 @vigdorchik vigdorchik committed with Jul 17, 2012
Showing with 17 additions and 23 deletions.
  1. +2 −2 main/Defaults.scala
  2. +8 −14 main/actions/CacheIvy.scala
  3. +2 −2 tasks/Execute.scala
  4. +3 −3 util/collection/Dag.scala
  5. +2 −2 util/collection/IDSet.scala
View
4 main/Defaults.scala
@@ -926,7 +926,7 @@ object Classpaths
} tag(Tags.Publish, Tags.Network)
import Cache._
- import CacheIvy.{classpathFormat, /*publishIC,*/ updateIC, updateReportF, excludeMap}
+ import CacheIvy.{classpathFormat, /*publishIC,*/ updateIC, updateReportFormat, excludeMap}
def withExcludes(out: File, classifiers: Seq[String], lock: xsbti.GlobalLock)(f: Map[ModuleID, Set[String]] => UpdateReport): UpdateReport =
{
@@ -944,7 +944,7 @@ object Classpaths
def cachedUpdate(cacheFile: File, label: String, module: IvySbt#Module, config: UpdateConfiguration, scalaInstance: Option[ScalaInstance], skip: Boolean, force: Boolean, depsUpdated: Boolean, log: Logger): UpdateReport =
{
implicit val updateCache = updateIC
- implicit val updateReport = updateReportF
+ implicit val updateReport = updateReportFormat
type In = IvyConfiguration :+: ModuleSettings :+: UpdateConfiguration :+: HNil
def work = (_: In) match { case conf :+: settings :+: config :+: HNil =>
log.info("Updating " + label + "...")
View
22 main/actions/CacheIvy.scala
@@ -10,8 +10,7 @@ package sbt
import java.net.URL
import Types.{:+:, idFun}
import scala.xml.NodeSeq
- import sbinary.{DefaultProtocol,Format}
- import DefaultProtocol.{immutableMapFormat, optionsAreFormat}
+ import sbinary.{DefaultProtocol, Format}
import RepositoryHelpers._
import Ordering._
@@ -57,30 +56,25 @@ object CacheIvy
/* def deliverIC: InputCache[IvyConfiguration :+: ModuleSettings :+: DeliverConfiguration :+: HNil] = implicitly
def publishIC: InputCache[IvyConfiguration :+: ModuleSettings :+: PublishConfiguration :+: HNil] = implicitly*/
- lazy val updateReportF: Format[UpdateReport] =
+ implicit lazy val updateReportFormat: Format[UpdateReport] =
{
- import DefaultProtocol.{BooleanFormat, FileFormat, StringFormat}
- updateReportFormat
- }
- implicit def updateReportFormat(implicit m: Format[String], cr: Format[ConfigurationReport], us: Format[UpdateStats]): Format[UpdateReport] =
- {
- import DefaultProtocol.FileFormat
+ import DefaultProtocol.{StringFormat, FileFormat}
wrap[UpdateReport, (File, Seq[ConfigurationReport], UpdateStats)](rep => (rep.cachedDescriptor, rep.configurations, rep.stats), { case (cd, cs, stats) => new UpdateReport(cd, cs, stats) })
}
implicit def updateStatsFormat: Format[UpdateStats] =
wrap[UpdateStats, (Long,Long,Long)]( us => (us.resolveTime, us.downloadTime, us.downloadSize), { case (rt, dt, ds) => new UpdateStats(rt, dt, ds, true) })
- implicit def confReportFormat(implicit mf: Format[ModuleID], mr: Format[ModuleReport]): Format[ConfigurationReport] =
+ implicit def confReportFormat(implicit m: Format[String], mr: Format[Seq[ModuleReport]], mi: Format[Seq[ModuleID]]): Format[ConfigurationReport] =
wrap[ConfigurationReport, (String,Seq[ModuleReport],Seq[ModuleID])]( r => (r.configuration, r.modules, r.evicted), { case (c,m,v) => new ConfigurationReport(c,m,v) })
- implicit def moduleReportFormat(implicit f: Format[Artifact], ff: Format[File], mid: Format[ModuleID]): Format[ModuleReport] =
+ implicit def moduleReportFormat(implicit ff: Format[File]): Format[ModuleReport] =
wrap[ModuleReport, (ModuleID, Seq[(Artifact, File)], Seq[Artifact])]( m => (m.module, m.artifacts, m.missingArtifacts), { case (m, as, ms) => new ModuleReport(m, as,ms) })
- implicit def artifactFormat(implicit sf: Format[String], of: Format[Seq[Configuration]], cf: Format[Configuration], uf: Format[Option[URL]]): Format[Artifact] =
+ implicit def artifactFormat(implicit sf: Format[String], uf: Format[Option[URL]]): Format[Artifact] = {
wrap[Artifact, (String,String,String,Option[String],Seq[Configuration],Option[URL],Map[String,String])](
a => (a.name, a.`type`, a.extension, a.classifier, a.configurations.toSeq, a.url, a.extraAttributes),
{ case (n,t,x,c,cs,u,e) => Artifact(n,t,x,c,cs,u,e) }
)
+ }
implicit def exclusionRuleFormat(implicit sf: Format[String]): Format[ExclusionRule] =
wrap[ExclusionRule, (String, String, String, Seq[String])]( e => (e.organization, e.name, e.artifact, e.configurations), { case (o,n,a,cs) => ExclusionRule(o,n,a,cs) })
-
implicit def crossVersionFormat: Format[CrossVersion] = wrap(crossToInt, crossFromInt)
private[this] final val DisabledValue = 0
@@ -91,7 +85,7 @@ object CacheIvy
private[this] val crossFromInt = (i: Int) => i match { case BinaryValue => new Binary(idFun); case FullValue => new Full(idFun); case _ => Disabled }
private[this] val crossToInt = (c: CrossVersion) => c match { case Disabled => 0; case b: Binary => BinaryValue; case f: Full => FullValue }
- implicit def moduleIDFormat(implicit sf: Format[String], af: Format[Artifact], bf: Format[Boolean], ef: Format[ExclusionRule]): Format[ModuleID] =
+ implicit def moduleIDFormat(implicit sf: Format[String], bf: Format[Boolean]): Format[ModuleID] =
wrap[ModuleID, ((String,String,String,Option[String]),(Boolean,Boolean,Boolean,Seq[Artifact],Seq[ExclusionRule],Map[String,String],CrossVersion))](
m => ((m.organization,m.name,m.revision,m.configurations), (m.isChanging, m.isTransitive, m.isForce, m.explicitArtifacts, m.exclusions, m.extraAttributes, m.crossVersion)),
{ case ((o,n,r,cs),(ch,t,f,as,excl,x,cv)) => ModuleID(o,n,r,cs,ch,t,f,as,excl,x,cv) }
View
4 tasks/Execute.scala
@@ -131,7 +131,7 @@ final class Execute[A[_] <: AnyRef](checkCycles: Boolean, triggers: Triggers[A])
results(node) = result
state(node) = Done
remove( reverse, node ) foreach { dep => notifyDone(node, dep) }
- callers.remove( node ).flatten.foreach { c => retire(c, callerResult(c, result)) }
+ callers.remove( node ).toList.flatten.foreach { c => retire(c, callerResult(c, result)) }
triggeredBy( node ) foreach { t => addChecked(t) }
post {
@@ -325,7 +325,7 @@ final class Execute[A[_] <: AnyRef](checkCycles: Boolean, triggers: Triggers[A])
{
if(node eq target) cyclic(node, target, "Cannot call self")
val all = IDSet.create[A[T]]
- def allCallers(n: A[T]): Unit = (all process n)(()) { callers.get(n).flatten.foreach(allCallers) }
+ def allCallers(n: A[T]): Unit = (all process n)(()) { callers.get(n).toList.flatten.foreach(allCallers) }
allCallers(node)
if(all contains target) cyclic(node, target, "Cyclic reference")
}
View
6 util/collection/Dag.scala
@@ -11,15 +11,15 @@ trait Dag[Node <: Dag[Node]]{
}
object Dag
{
- import scala.collection.{mutable, JavaConversions};
- import JavaConversions.{asIterable, asSet}
+ import scala.collection.{mutable, JavaConverters}
+ import JavaConverters.asScalaSetConverter
def topologicalSort[T](root: T)(dependencies: T => Iterable[T]): List[T] = topologicalSort(root :: Nil)(dependencies)
def topologicalSort[T](nodes: Iterable[T])(dependencies: T => Iterable[T]): List[T] =
{
val discovered = new mutable.HashSet[T]
- val finished = asSet(new java.util.LinkedHashSet[T])
+ val finished = (new java.util.LinkedHashSet[T]).asScala
def visitAll(nodes: Iterable[T]) = nodes foreach visit
def visit(node : T){
View
4 util/collection/IDSet.scala
@@ -37,9 +37,9 @@ object IDSet
def += (t: T) = backing.put(t, Dummy)
def ++=(t: Iterable[T]) = t foreach +=
def -= (t:T) = if(backing.remove(t) eq null) false else true
- def all = collection.JavaConversions.asIterable(backing.keySet)
+ def all = collection.JavaConversions.asScalaIterable(backing.keySet)
def isEmpty = backing.isEmpty
def process[S](t: T)(ifSeen: S)(ifNew: => S) = if(contains(t)) ifSeen else { this += t ; ifNew }
override def toString = backing.toString
}
-}
+}

0 comments on commit ed9ea1c

Please sign in to comment.