Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes sbt#1634. Adds inconsistent duplicate warning
sbt#1634 is about a library getting wiped out of deps graph when it’s included twice in ascending order of version. I’d say that’s a logically inconsistent state, and we should just issue warning instead of trying to fix it.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package sbt | ||
|
||
import org.specs2._ | ||
|
||
class InconsistentDuplicateSpec extends Specification { | ||
def is = s2""" | ||
|
||
This is a specification to check the inconsistent duplicate warnings | ||
|
||
Duplicate with different version should | ||
be warned $warn1 | ||
|
||
Duplicate with same version should | ||
not be warned $nodupe1 | ||
""" | ||
|
||
def akkaActor214 = ModuleID("com.typesafe.akka", "akka-actor", "2.1.4", Some("compile")) cross CrossVersion.binary | ||
def akkaActor230 = ModuleID("com.typesafe.akka", "akka-actor", "2.3.0", Some("compile")) cross CrossVersion.binary | ||
def akkaActor230Test = ModuleID("com.typesafe.akka", "akka-actor", "2.3.0", Some("test")) cross CrossVersion.binary | ||
|
||
def warn1 = | ||
IvySbt.inconsistentDuplicateWarning(Seq(akkaActor214, akkaActor230)) must_== | ||
List("Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:", | ||
" * com.typesafe.akka:akka-actor:(2.1.4, 2.3.0)") | ||
|
||
def nodupe1 = | ||
IvySbt.inconsistentDuplicateWarning(Seq(akkaActor230Test, akkaActor230)) must_== Nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[@cunei]: https://github.com/cunei | ||
[@eed3si9n]: https://github.com/eed3si9n | ||
[@gkossakowski]: https://github.com/gkossakowski | ||
[@jsuereth]: https://github.com/jsuereth | ||
[1634]: https://github.com/sbt/sbt/pull/1634 | ||
|
||
### Fixes with compatibility implications | ||
|
||
### Improvements | ||
|
||
### Bug fixes | ||
|
||
- Issues warning if multiple dependencies to a same library is found with different version. [#1634][1634] by [@eed3si9n][@eed3si9n] |