Browse files

cleanup of #585: compatible with earlier launchers

  • Loading branch information...
1 parent 835ee0d commit e532d20732744045ebe3bb4ca0419e7b106922fd @harrah committed Oct 29, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 ivy/IvyInterface.scala
  2. +6 −1 main/Defaults.scala
View
2 ivy/IvyInterface.scala
@@ -89,7 +89,7 @@ final class Patterns(val ivyPatterns: Seq[String], val artifactPatterns: Seq[Str
case _ => false
}
}
- override def hashCode: Int = 617 * ivyPatterns.## + 37 * artifactPatterns.## + isMavenCompatible.hashCode
+ override def hashCode: Int = (ivyPatterns, artifactPatterns, isMavenCompatible).hashCode
}
object Patterns
{
View
7 main/Defaults.scala
@@ -1211,13 +1211,18 @@ object Classpaths
def bootRepositories(app: xsbti.AppConfiguration): Option[Seq[Resolver]] =
try { Some(app.provider.scalaProvider.launcher.ivyRepositories.toSeq map bootRepository) }
catch { case _: NoSuchMethodError => None }
+
+ private[this] def mavenCompatible(ivyRepo: xsbti.IvyRepository): Boolean =
+ try { ivyRepo.mavenCompatible }
+ catch { case _: NoSuchMethodError => false }
+
private[this] def bootRepository(repo: xsbti.Repository): Resolver =
{
import xsbti.Predefined
repo match
{
case m: xsbti.MavenRepository => MavenRepository(m.id, m.url.toString)
- case i: xsbti.IvyRepository => Resolver.url(i.id, i.url)(Patterns(i.ivyPattern :: Nil, i.artifactPattern :: Nil, i.mavenCompatible))
+ case i: xsbti.IvyRepository => Resolver.url(i.id, i.url)(Patterns(i.ivyPattern :: Nil, i.artifactPattern :: Nil, mavenCompatible(i)))
case p: xsbti.PredefinedRepository => p.id match {
case Predefined.Local => Resolver.defaultLocal
case Predefined.MavenLocal => Resolver.mavenLocal

0 comments on commit e532d20

Please sign in to comment.