mirror of
https://github.com/sbt/sbt.git
synced 2026-09-03 16:39:24 +02:00
Fix test setup to be accurate.
This commit is contained in:
@@ -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")
|
||||
|
||||
}
|
||||
+6
@@ -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>
|
||||
-6
@@ -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>
|
||||
Reference in New Issue
Block a user