Skip to content

Commit 455e4a0

Browse files
committed
scala-xml dependency should be provided
Nothing should transitively depend on the scala-xml module except for scaladoc and library-all. Compiler needs scala-xml as a build dependency, but not at runtime. The user is supposed to provide scala-xml as a dependency at runtime. This fixes an issue where the classpath in SBT shadows the scala-xml module, see scala/scala-module-dependency-sample#14. Unfortunately, scaladoc needs to be pulled out of the compiler. This is a first attempt at mangling the build so that scaladoc is a separate jar. Following on, SBT will need to know how to run scaladoc as a separate jar.
1 parent fe6160c commit 455e4a0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

build.sbt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,18 +392,16 @@ lazy val compiler = configureAsSubproject(project)
392392
description := "Scala Compiler",
393393
libraryDependencies ++= Seq(antDep, asmDep),
394394
// These are only needed for the POM:
395-
// TODO: jline dependency is only needed for the REPL shell, which should move to its own jar
396-
libraryDependencies ++= Seq(scalaXmlDep, jlineDep),
395+
libraryDependencies ++= Seq(jlineDep),
397396
buildCharacterPropertiesFile := (resourceManaged in Compile).value / "scala-buildcharacter.properties",
398397
resourceGenerators in Compile += generateBuildCharacterPropertiesFile.map(file => Seq(file)).taskValue,
399-
// this a way to make sure that classes from interactive and scaladoc projects
398+
// this a way to make sure that classes from interactive and repl projects
400399
// end up in compiler jar. note that we need to use LocalProject references
401400
// (with strings) to deal with mutual recursion
402401
products in Compile in packageBin :=
403402
(products in Compile in packageBin).value ++
404403
Seq((dependencyClasspath in Compile).value.find(_.get(moduleID.key) == Some(asmDep)).get.data) ++
405404
(products in Compile in packageBin in LocalProject("interactive")).value ++
406-
(products in Compile in packageBin in LocalProject("scaladoc")).value ++
407405
(products in Compile in packageBin in LocalProject("repl")).value ++
408406
(products in Compile in packageBin in LocalProject("repl-frontend")).value,
409407
includeFilter in unmanagedResources in Compile :=
@@ -413,15 +411,13 @@ lazy val compiler = configureAsSubproject(project)
413411
mappings in Compile in packageSrc ++= {
414412
val base = (unmanagedResourceDirectories in Compile).value ++
415413
(unmanagedResourceDirectories in Compile in LocalProject("interactive")).value ++
416-
(unmanagedResourceDirectories in Compile in LocalProject("scaladoc")).value ++
417414
(unmanagedResourceDirectories in Compile in LocalProject("repl")).value
418415
base ** ((includeFilter in unmanagedResources in Compile).value || "*.scala" || "*.psd" || "*.ai" || "*.java") pair relativeTo(base)
419416
},
420-
// Include the additional projects in the scaladoc JAR:
417+
// Include the additional projects in the compiler JAR:
421418
sources in Compile in doc ++= {
422419
val base =
423420
(unmanagedSourceDirectories in Compile in LocalProject("interactive")).value ++
424-
(unmanagedSourceDirectories in Compile in LocalProject("scaladoc")).value ++
425421
(unmanagedSourceDirectories in Compile in LocalProject("repl")).value
426422
((base ** ("*.scala" || "*.java"))
427423
--- (base ** "Scaladoc*ModelTest.scala") // exclude test classes that depend on partest
@@ -482,7 +478,7 @@ lazy val replFrontend = configureAsSubproject(Project("repl-frontend", file(".")
482478

483479
lazy val scaladoc = configureAsSubproject(project)
484480
.settings(disableDocs)
485-
.settings(disablePublishing)
481+
.settings(commonSettings)
486482
.settings(
487483
name := "scala-compiler-doc",
488484
description := "Scala Documentation Generator",

0 commit comments

Comments
 (0)