mirror of https://github.com/sbt/sbt.git
Formatting / styling
This commit is contained in:
parent
f86238ec3e
commit
aea6e958ea
|
|
@ -15,7 +15,11 @@ object CentralTests extends TestSuite {
|
|||
|
||||
implicit val cachePolicy = CachePolicy.Default
|
||||
|
||||
def resolve(deps: Set[Dependency], filter: Option[Dependency => Boolean] = None, extraRepo: Option[Repository] = None) = {
|
||||
def resolve(
|
||||
deps: Set[Dependency],
|
||||
filter: Option[Dependency => Boolean] = None,
|
||||
extraRepo: Option[Repository] = None
|
||||
) = {
|
||||
val repositories0 = extraRepo.toSeq ++ repositories
|
||||
|
||||
Resolution(deps, filter = filter)
|
||||
|
|
@ -25,16 +29,42 @@ object CentralTests extends TestSuite {
|
|||
}
|
||||
|
||||
def repr(dep: Dependency) =
|
||||
s"${dep.module.organization}:${dep.module.name}:${dep.attributes.`type`}:${Some(dep.attributes.classifier).filter(_.nonEmpty).map(_+":").mkString}${dep.version}"
|
||||
(
|
||||
Seq(
|
||||
dep.module.organization,
|
||||
dep.module.name,
|
||||
dep.attributes.`type`
|
||||
) ++
|
||||
Some(dep.attributes.classifier)
|
||||
.filter(_.nonEmpty)
|
||||
.toSeq ++
|
||||
Seq(
|
||||
dep.version
|
||||
)
|
||||
).mkString(":")
|
||||
|
||||
def resolutionCheck(module: Module, version: String, extraRepo: Option[Repository] = None) =
|
||||
def resolutionCheck(
|
||||
module: Module,
|
||||
version: String,
|
||||
extraRepo: Option[Repository] = None
|
||||
) =
|
||||
async {
|
||||
val expected = await(textResource(s"resolutions/${module.organization}:${module.name}:$version")).split('\n').toSeq
|
||||
val expected =
|
||||
await(
|
||||
textResource(s"resolutions/${module.organization}:${module.name}:$version")
|
||||
)
|
||||
.split('\n')
|
||||
.toSeq
|
||||
|
||||
val dep = Dependency(module, version)
|
||||
val res = await(resolve(Set(dep), extraRepo = extraRepo))
|
||||
|
||||
val result = res.dependencies.toVector.map(repr).sorted.distinct
|
||||
val result = res
|
||||
.dependencies
|
||||
.toVector
|
||||
.map(repr)
|
||||
.sorted
|
||||
.distinct
|
||||
|
||||
for (((e, r), idx) <- expected.zip(result).zipWithIndex if e != r)
|
||||
println(s"Line $idx:\n expected: $e\n got:$r")
|
||||
|
|
@ -94,10 +124,16 @@ object CentralTests extends TestSuite {
|
|||
}
|
||||
}
|
||||
'spark{
|
||||
resolutionCheck(Module("org.apache.spark", "spark-core_2.11"), "1.3.1")
|
||||
resolutionCheck(
|
||||
Module("org.apache.spark", "spark-core_2.11"),
|
||||
"1.3.1"
|
||||
)
|
||||
}
|
||||
'argonautShapeless{
|
||||
resolutionCheck(Module("com.github.alexarchambault", "argonaut-shapeless_6.1_2.11"), "0.2.0")
|
||||
resolutionCheck(
|
||||
Module("com.github.alexarchambault", "argonaut-shapeless_6.1_2.11"),
|
||||
"0.2.0"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue