mirror of https://github.com/sbt/sbt.git
Fix test setup to be accurate.
This commit is contained in:
parent
3613cc8c39
commit
6f2c4a8d10
|
|
@ -11,6 +11,8 @@ val checkDependencies = taskKey[Unit]("Checks that dependcies are correct.")
|
|||
checkDependencies := {
|
||||
val hasBadJar = (fullClasspath in Compile).value.exists { jar => jar.data.getName contains "bottom-1.0.0.jar"}
|
||||
val errorJarString = (fullClasspath in Compile).value.map(_.data.getName).mkString(" * ", "\n * ", "")
|
||||
val hasBadMiddleJar = (fullClasspath in Compile).value.exists { jar => jar.data.getName contains "middle-1.0.0.jar"}
|
||||
assert(!hasBadMiddleJar, s"Failed to exclude excluded dependency on classpath!\nFound:\n$errorJarString")
|
||||
assert(!hasBadJar, s"Failed to exclude transitive excluded dependency on classpath!\nFound:\n$errorJarString")
|
||||
val modules =
|
||||
(for {
|
||||
|
|
@ -22,7 +24,12 @@ checkDependencies := {
|
|||
modules exists { m =>
|
||||
(m.organization == "exclude.test") && (m.name == "bottom")
|
||||
}
|
||||
val hasBadMiddleDep =
|
||||
modules exists { m =>
|
||||
(m.organization == "exclude.test") && (m.name == "middle")
|
||||
}
|
||||
val errModuleString = modules.mkString("\n * ", "\n * ", "")
|
||||
assert(!hasBadMiddleDep, s"Failed to exclude transitive excluded dependency!\nFound:\n$errModuleString")
|
||||
assert(!hasBadDep, s"Failed to exclude transitive excluded dependency!\nFound:\n$errModuleString")
|
||||
|
||||
}
|
||||
|
|
@ -12,6 +12,12 @@
|
|||
<groupId>exclude.test</groupId>
|
||||
<artifactId>top</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>exclude.test</groupId>
|
||||
<artifactId>middle</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -12,12 +12,6 @@
|
|||
<groupId>exclude.test</groupId>
|
||||
<artifactId>middle</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>exclude.test</groupId>
|
||||
<artifactId>middle</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
Loading…
Reference in New Issue