diff --git a/ivy/src/main/scala/sbt/IvyScala.scala b/ivy/src/main/scala/sbt/IvyScala.scala index b4299906f..d2697e308 100644 --- a/ivy/src/main/scala/sbt/IvyScala.scala +++ b/ivy/src/main/scala/sbt/IvyScala.scala @@ -66,7 +66,12 @@ private object IvyScala { { val id = dep.getDependencyRevisionId val depBinaryVersion = CrossVersion.binaryScalaVersion(id.getRevision) - val mismatched = id.getOrganisation == Organization && depBinaryVersion != scalaBinaryVersion && dep.getModuleConfigurations.exists(configSet) + def isScalaLangOrg = id.getOrganisation == Organization + def isNotScalaActorsMigration = !(id.getName startsWith "scala-actors-migration") // Exception to the rule: sbt/sbt#1818 + def isNotScalaPickling = !(id.getName startsWith "scala-pickling") // Exception to the rule: sbt/sbt#1899 + def hasBinVerMismatch = depBinaryVersion != scalaBinaryVersion + def matchesOneOfTheConfigs = dep.getModuleConfigurations.exists(configSet) + val mismatched = isScalaLangOrg && isNotScalaActorsMigration && isNotScalaPickling && hasBinVerMismatch && matchesOneOfTheConfigs if (mismatched) Some("Binary version (" + depBinaryVersion + ") for dependency " + id + "\n\tin " + module.getModuleRevisionId + @@ -111,4 +116,4 @@ private object IvyScala { configurationNames.foreach(rule.addConfiguration) rule } -} \ No newline at end of file +} diff --git a/notes/0.13.8.markdown b/notes/0.13.8.markdown index f35a9c981..ef91341c4 100644 --- a/notes/0.13.8.markdown +++ b/notes/0.13.8.markdown @@ -39,8 +39,10 @@ [1787]: https://github.com/sbt/sbt/pull/1787 [1793]: https://github.com/sbt/sbt/pull/1793 [1817]: https://github.com/sbt/sbt/pull/1817 + [1818]: https://github.com/sbt/sbt/pull/1818 [1869]: https://github.com/sbt/sbt/issues/1869 [1871]: https://github.com/sbt/sbt/pull/1871 + [1899]: https://github.com/sbt/sbt/pull/1899 ### Changes with compatibility implications @@ -75,6 +77,7 @@ - Issues warning if multiple dependencies to a same library is found with different version. [#1634][1634] by [@eed3si9n][@eed3si9n] - Removes "No main class detected" warning. [#1766][1766] by [@eed3si9n][@eed3si9n] - Disable publishing on implicitly created root project by not enabling `IvyPlugin` by default (`-Dsbt.root.ivyplugin=true` will revert this behavior). [#1871][1871]/[#1869][1869] by [@dwijnand][@dwijnand] +- Exempt org.scala-lang:scala-actors-migration and org.scala-lang:scala-pickling from scala binary version checks. [#1818][1818]/[#1899][1899] by [@dwijnand][@dwijnand] ### Rolling back XML parsing workaround diff --git a/sbt/src/sbt-test/dependency-management/scala-version-check-exempt/build.sbt b/sbt/src/sbt-test/dependency-management/scala-version-check-exempt/build.sbt new file mode 100644 index 000000000..6f66bc879 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/scala-version-check-exempt/build.sbt @@ -0,0 +1,17 @@ +// https://github.com/sbt/sbt/issues/1818 + +scalaVersion := "2.11.5" +libraryDependencies += "org.scala-lang" %% "scala-actors-migration" % "1.1.0" +libraryDependencies += "org.scala-lang" %% "scala-pickling" % "0.9.1" + +lazy val check = taskKey[Unit]("Runs the check") + +check := { + val lastLog = BuiltinCommands lastLogFile state.value + val last = IO read lastLog.get + def containsWarn1 = last contains "Binary version (1.1.0) for dependency org.scala-lang#scala-actors-migration_2.11;1.1.0" + def containsWarn2 = last contains "Binary version (0.9.1) for dependency org.scala-lang#scala-pickling_2.11;0.9.1" + def containsWarn3 = last contains "differs from Scala binary version in project (2.11)." + if (containsWarn1 && containsWarn3) sys error "scala-actors-migration isn't exempted from the Scala binary version check" + if (containsWarn2 && containsWarn3) sys error "scala-pickling isn't exempted from the Scala binary version check" +} diff --git a/sbt/src/sbt-test/dependency-management/scala-version-check-exempt/test b/sbt/src/sbt-test/dependency-management/scala-version-check-exempt/test new file mode 100644 index 000000000..762c62539 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/scala-version-check-exempt/test @@ -0,0 +1,2 @@ +> update +> check