Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 48f9601

Browse files
Merge pull request #6 from gkossakowski/update-to-scala-M6
Upgrade to Scala 2.11.0-M6.
2 parents 3a1df25 + 062f7f3 commit 48f9601

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

‎build.sbt‎

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ name := "scala-parser-combinators"
44

55
version := "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
1515
scalacOptions 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?)
8888
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+
}
92116
else Seq.empty
93117
)
94118

95-
96-
// necessary for partest -- see comments in its build.sbt
97-
conflictWarning ~= { _.copy(failOnConflict = false) }
98-
99119
fork in Test := true
100120

101121
javaOptions in Test += "-Xmx1G"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /