Skip to content

Commit

Permalink
move dependency mapping to IvySbt#Module
Browse files Browse the repository at this point in the history
  • Loading branch information
harrah committed Jul 6, 2011
1 parent 179a2a3 commit aebde6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ivy/Ivy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ final class IvySbt(val configuration: IvyConfiguration)
withIvy[T](log) { ivy => f(ivy, moduleDescriptor0, defaultConfig0) }

def moduleDescriptor(log: Logger): DefaultModuleDescriptor = withModule(log)((_,md,_) => md)
def dependencyMapping(log: Logger): (ModuleRevisionId, ModuleDescriptor) =
{
val md = moduleDescriptor(log)
(md.getModuleRevisionId, md)
}
def defaultConfig(log: Logger): String = withModule(log)( (_,_,dc) => dc)
// these should only be referenced by withModule because lazy vals synchronize on this object
// withIvy explicitly locks the IvySbt object, so they have to be done in the right order to avoid deadlock
Expand Down
5 changes: 1 addition & 4 deletions main/Defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,7 @@ object Classpaths

def depMap(projects: Seq[(ProjectRef,ResolvedProject)], data: Settings[Scope], log: Logger): Task[Map[ModuleRevisionId, ModuleDescriptor]] =
projects.flatMap { case (p,_) => ivyModule in p get data }.join.map { mods =>
(mods.map{ mod =>
val md = mod.moduleDescriptor(log)
(md.getModuleRevisionId, md)
}).toMap
mods map { _.dependencyMapping(log) } toMap ;
}

def projectResolverTask: Initialize[Task[Resolver]] =
Expand Down

0 comments on commit aebde6b

Please sign in to comment.