@@ -4,12 +4,12 @@ name := "scala-parser-combinators"
44
55version := " 1.0.0-SNAPSHOT"
66
7- scalaVersion := " 2.11.0-M5 "
7+ scalaVersion := " 2.11.0-M6 "
88
99// NOTE: not necessarily equal to scalaVersion
1010// (e.g., during PR validation, we override scalaVersion to validate,
1111// but don't rebuild scalacheck, so we don't want to rewire that dependency)
12- scalaBinaryVersion := " 2.11.0-M5 "
12+ scalaBinaryVersion := " 2.11.0-M6 "
1313
1414// don't use for doc scope, scaladoc warnings are not to be reckoned with
1515scalacOptions in compile ++= Seq (" -optimize" , " -Xfatal-warnings" , " -feature" , " -deprecation" , " -unchecked" , " -Xlint" )
@@ -86,16 +86,36 @@ TestKeys.partestVersion := "1.0.0-RC6"
8686// so that it can link to the compiler/lib we're using (testing)
8787// NOTE: not sure why, but the order matters (maybe due to the binary version conflicts for xml/parser combinators pulled in for scaladoc?)
8888libraryDependencies ++= (
89- if (TestKeys .includeTestDependencies.value)
90- Seq (" org.scala-lang.modules" %% " scala-partest-interface" % " 0.2" % " test" ,
91- " org.scala-lang.modules" %% " scala-partest" % TestKeys .partestVersion.value % " test" )
89+ if (TestKeys .includeTestDependencies.value) {
90+ /**
91+ * Exclude all transitive dependencies of partest that include scala-parser-combinators.
92+ * This way we avoid having two (or more) versions of scala-parser-combinators on a classpath.
93+ * See this comment which describes the same issue for scala-xml
94+ * https://github.com/scala/scala-xml/pull/6#issuecomment-26614894
95+ *
96+ * Note that we are using ModuleID.exclude instead of more flexible ModuleID.excludeAll
97+ * (describe here: http://www.scala-sbt.org/release/docs/Detailed-Topics/Library-Management#exclude-transitive-dependencies)
98+ * because only plain excludes are incorporated in generated pom.xml. There are two ways
99+ * to address this problem:
100+ *
101+ * 1. Figure out how to depend on partest in non-transitive way: not include that dependency
102+ * in generated pom.xml for scala-parser-combinators.
103+ * 2. Declare dependencies in partest as provided so they are not includeded transitively.
104+ */
105+ def excludeScalaXml (dep : ModuleID ): ModuleID =
106+ dep.exclude(" org.scala-lang.modules" , " scala-parser-combinators_2.11.0-M4" ).
107+ exclude(" org.scala-lang.modules" , " scala-parser-combinators_2.11.0-M5" ).
108+ exclude(" org.scala-lang.modules" , " scala-parser-combinators_2.11.0-M6" )
109+ Seq (" org.scala-lang.modules" % " scala-partest-interface_2.11.0-M5" % " 0.2" % " test" intransitive,
110+ " org.scala-lang.modules" % " scala-partest_2.11.0-M5" % TestKeys .partestVersion.value % " test" intransitive,
111+ // diffutils is needed by partest
112+ " com.googlecode.java-diff-utils" % " diffutils" % " 1.3.0" % " test" ,
113+ " org.scala-lang" % " scala-compiler" % scalaVersion.value % " test" ).
114+ map(excludeScalaXml)
115+ }
92116 else Seq .empty
93117)
94118
95-
96- // necessary for partest -- see comments in its build.sbt
97- conflictWarning ~= { _.copy(failOnConflict = false ) }
98-
99119fork in Test := true
100120
101121javaOptions in Test += " -Xmx1G"
0 commit comments