Remove now unnecessary checks

This commit is contained in:
Alexandre Archambault 2016-04-09 01:28:09 +02:00
parent c22ba8ba6a
commit da78c523fb
No known key found for this signature in database
GPG Key ID: 14640A6839C263A9
3 changed files with 34 additions and 29 deletions

View File

@ -41,43 +41,15 @@ object Fetch {
val task = lookups.foldLeft[F[Seq[String] \/ (Artifact.Source, Project)]](F.point(-\/(Nil))) {
case (acc, (repo, eitherProjTask)) =>
val looseModuleValidation = repo match {
case m: MavenRepository => m.sbtAttrStub // that sucks so much
case _ => false
}
val moduleCmp = if (looseModuleValidation) module.copy(attributes = Map.empty) else module
F.bind(acc) {
case -\/(errors) =>
F.map(eitherProjTask)(_.flatMap{case (source, project) =>
val projModule =
if (looseModuleValidation)
project.module.copy(attributes = Map.empty)
else
project.module
if (projModule == moduleCmp) \/-((source, project))
else -\/(s"Wrong module returned (expected: $moduleCmp, got: ${project.module})")
}.leftMap(error => error +: errors))
F.map(eitherProjTask)(_.leftMap(error => error +: errors))
case res @ \/-(_) =>
F.point(res)
}
}
EitherT(F.map(task)(_.leftMap(_.reverse)))
.map {case x @ (source, proj) =>
val looseModuleValidation = source match {
case m: MavenSource => m.sbtAttrStub // omfg
case _ => false
}
val projModule =
if (looseModuleValidation)
proj.module.copy(attributes = Map.empty)
else
proj.module
val moduleCmp = if (looseModuleValidation) module.copy(attributes = Map.empty) else module
assert(projModule == moduleCmp)
x
}
}
def from[F[_]](

View File

@ -0,0 +1,26 @@
cc.factorie:factorie_2.11:1.2:compile
com.fasterxml.jackson.core:jackson-annotations:2.3.0:compile
com.fasterxml.jackson.core:jackson-core:2.3.1:compile
com.fasterxml.jackson.core:jackson-databind:2.3.1:compile
com.google.code.findbugs:jsr305:1.3.9:compile
com.google.guava:guava:12.0:compile
com.thoughtworks.paranamer:paranamer:2.6:compile
commons-codec:commons-codec:1.2:compile
commons-httpclient:commons-httpclient:3.1:compile
commons-lang:commons-lang:2.6:compile
commons-logging:commons-logging:1.0.4:compile
info.bliki.wiki:bliki-core:3.0.19:compile
org.apache.commons:commons-compress:1.8:compile
org.jblas:jblas:1.2.3:compile
org.json4s:json4s-ast_2.11:3.2.9:compile
org.json4s:json4s-core_2.11:3.2.9:compile
org.json4s:json4s-jackson_2.11:3.2.9:compile
org.mongodb:mongo-java-driver:2.12.3:compile
org.scala-lang:scala-compiler:2.11.7:compile
org.scala-lang:scala-library:2.11.7:compile
org.scala-lang:scala-reflect:2.11.7:compile
org.scala-lang:scalap:2.11.0:compile
org.scala-lang.modules:scala-parser-combinators_2.11:1.0.4:compile
org.scala-lang.modules:scala-xml_2.11:1.0.4:compile
org.tukaani:xz:1.5:compile
org.xerial.snappy:snappy-java:1.1.1.3:compile

View File

@ -203,6 +203,13 @@ object CentralTests extends TestSuite {
)
}
'artifactIdProperties - {
resolutionCheck(
Module("cc.factorie", "factorie_2.11"),
"1.2"
)
}
'latestRevision - {
* - resolutionCheck(
Module("com.chuusai", "shapeless_2.11"),