Skip to content

Commit 034ccfd

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 5b9ed75 commit 034ccfd

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

build.sbt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,17 +395,16 @@ lazy val compiler = configureAsSubproject(project)
395395
description := "Scala Compiler",
396396
libraryDependencies ++= Seq(antDep, asmDep),
397397
// These are only needed for the POM:
398-
libraryDependencies ++= Seq(scalaXmlDep, jlineDep % "optional"),
398+
libraryDependencies ++= Seq(jlineDep % "optional"),
399399
buildCharacterPropertiesFile := (resourceManaged in Compile).value / "scala-buildcharacter.properties",
400400
resourceGenerators in Compile += generateBuildCharacterPropertiesFile.map(file => Seq(file)).taskValue,
401-
// this a way to make sure that classes from interactive and scaladoc projects
401+
// this a way to make sure that classes from interactive and repl projects
402402
// end up in compiler jar. note that we need to use LocalProject references
403403
// (with strings) to deal with mutual recursion
404404
products in Compile in packageBin :=
405405
(products in Compile in packageBin).value ++
406406
Seq((dependencyClasspath in Compile).value.find(_.get(moduleID.key) == Some(asmDep)).get.data) ++
407407
(products in Compile in packageBin in LocalProject("interactive")).value ++
408-
(products in Compile in packageBin in LocalProject("scaladoc")).value ++
409408
(products in Compile in packageBin in LocalProject("repl")).value ++
410409
(products in Compile in packageBin in LocalProject("repl-jline")).value ++
411410
(products in Compile in packageBin in LocalProject("repl-jline-embedded")).value,
@@ -416,15 +415,13 @@ lazy val compiler = configureAsSubproject(project)
416415
mappings in Compile in packageSrc ++= {
417416
val base = (unmanagedResourceDirectories in Compile).value ++
418417
(unmanagedResourceDirectories in Compile in LocalProject("interactive")).value ++
419-
(unmanagedResourceDirectories in Compile in LocalProject("scaladoc")).value ++
420418
(unmanagedResourceDirectories in Compile in LocalProject("repl")).value
421419
base ** ((includeFilter in unmanagedResources in Compile).value || "*.scala" || "*.psd" || "*.ai" || "*.java") pair relativeTo(base)
422420
},
423-
// Include the additional projects in the scaladoc JAR:
421+
// Include the additional projects in the compiler JAR:
424422
sources in Compile in doc ++= {
425423
val base =
426424
(unmanagedSourceDirectories in Compile in LocalProject("interactive")).value ++
427-
(unmanagedSourceDirectories in Compile in LocalProject("scaladoc")).value ++
428425
(unmanagedSourceDirectories in Compile in LocalProject("repl")).value
429426
((base ** ("*.scala" || "*.java"))
430427
--- (base ** "Scaladoc*ModelTest.scala") // exclude test classes that depend on partest
@@ -522,7 +519,7 @@ lazy val replJlineEmbedded = Project("repl-jline-embedded", file(".") / "target"
522519

523520
lazy val scaladoc = configureAsSubproject(project)
524521
.settings(disableDocs)
525-
.settings(disablePublishing)
522+
.settings(commonSettings)
526523
.settings(
527524
name := "scala-compiler-doc",
528525
description := "Scala Documentation Generator",

0 commit comments

Comments
 (0)