Skip to content

Commit 0849761

Browse files
committed
Exclude transitive scala-library dependency
Scaladoc depends on scala-xml, etc, built with the previous stable version of Scala. This isn't ideal, but we're stuck with this for now. We were relying on Ivy to evict the transitive dependency on the old version of scala-library. However, SBT treats evictions of scala-library as suspicious and emits a custom warning. This commit explicitly excludes the transitive dependency so as to avoid these warnings. It also makes the output of `show update` a little easier to read.
1 parent dbcedfb commit 0849761

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

build.sbt

+12-12
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@
5050
* https://groups.google.com/d/topic/scala-internals/gp5JsM1E0Fo/discussion
5151
*/
5252

53+
val boostrapScalaVersion = "2.11.5"
54+
5355
lazy val commonSettings = Seq[Setting[_]](
5456
organization := "org.scala-lang",
5557
version := "2.11.6-SNAPSHOT",
56-
scalaVersion := "2.11.5",
58+
scalaVersion := boostrapScalaVersion,
5759
// we don't cross build Scala itself
5860
crossPaths := false,
5961
// do not add Scala library jar as a dependency automatically
@@ -154,13 +156,13 @@ lazy val repl = configureAsSubproject(project).
154156
settings(disableDocsAndPublishingTasks: _*).
155157
dependsOn(compiler)
156158

159+
def moduleDependency(name: String) =
160+
// exclusion of the scala-library transitive dependency avoids eviction warnings during `update`.
161+
"org.scala-lang.modules" %% name % "1.0.3" exclude("org.scala-lang", "scala-library")
162+
157163
lazy val scaladoc = configureAsSubproject(project).
158164
settings(
159-
libraryDependencies ++= Seq(
160-
"org.scala-lang.modules" %% "scala-xml" % "1.0.3",
161-
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.3",
162-
"org.scala-lang.modules" %% "scala-partest" % "1.0.5"
163-
)
165+
libraryDependencies ++= Seq("scala-xml", "scala-parser-combinators", "scala-partest").map(moduleDependency)
164166
).
165167
settings(disableDocsAndPublishingTasks: _*).
166168
dependsOn(compiler)
@@ -179,12 +181,10 @@ lazy val asm = configureAsForkOfJavaProject(project)
179181

180182
lazy val root = (project in file(".")).
181183
aggregate(library, forkjoin, reflect, compiler, asm, interactive, repl,
182-
scaladoc, scalap).
183-
// make the root project an aggragate-only
184-
// we disable sbt's built-in Ivy plugin in the root project
185-
// so it doesn't produce any artifact including not building
186-
// an empty jar
187-
disablePlugins(plugins.IvyPlugin)
184+
scaladoc, scalap).settings(
185+
scalaVersion := boostrapScalaVersion,
186+
ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
187+
)
188188

189189
/**
190190
* Configures passed project as a subproject (e.g. compiler or repl)

0 commit comments

Comments
 (0)