@@ -4,12 +4,12 @@ name := "scala-parser-combinators"
4
4
5
5
version := " 1.0.0-SNAPSHOT"
6
6
7
- scalaVersion := " 2.11.0-M5 "
7
+ scalaVersion := " 2.11.0-M6 "
8
8
9
9
// NOTE: not necessarily equal to scalaVersion
10
10
// (e.g., during PR validation, we override scalaVersion to validate,
11
11
// 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 "
13
13
14
14
// don't use for doc scope, scaladoc warnings are not to be reckoned with
15
15
scalacOptions in compile ++= Seq (" -optimize" , " -Xfatal-warnings" , " -feature" , " -deprecation" , " -unchecked" , " -Xlint" )
@@ -86,16 +86,36 @@ TestKeys.partestVersion := "1.0.0-RC6"
86
86
// so that it can link to the compiler/lib we're using (testing)
87
87
// NOTE: not sure why, but the order matters (maybe due to the binary version conflicts for xml/parser combinators pulled in for scaladoc?)
88
88
libraryDependencies ++= (
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
+ }
92
116
else Seq .empty
93
117
)
94
118
95
-
96
- // necessary for partest -- see comments in its build.sbt
97
- conflictWarning ~= { _.copy(failOnConflict = false ) }
98
-
99
119
fork in Test := true
100
120
101
121
javaOptions in Test += " -Xmx1G"
0 commit comments