Skip to content

Commit

Permalink
[SPARK-22855][BUILD] Add -no-java-comments to sbt docs/scalacOptions …
Browse files Browse the repository at this point in the history
…on scala 2.12

Prevents Scala 2.12 scaladoc from blowing up attempting to parse java comments. Also
moves scaladoc configs out of the TestSettings and into the standard sharedSettings
section in SparkBuild.scala.
  • Loading branch information
easel committed Dec 21, 2017
1 parent 9c289a5 commit 9f3407a
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,21 @@ object SparkBuild extends PomBuild {
"-sourcepath", (baseDirectory in ThisBuild).value.getAbsolutePath // Required for relative source links in scaladoc
),

// Remove certain packages from Scaladoc
scalacOptions in (Compile, doc) := Seq(
"-groups",
"-skip-packages", Seq(
"org.apache.spark.api.python",
"org.apache.spark.network",
"org.apache.spark.deploy",
"org.apache.spark.util.collection"
).mkString(":"),
"-doc-title", "Spark " + version.value.replaceAll("-SNAPSHOT", "") + " ScalaDoc"
) ++ {
// Do not attempt to scaladoc javadoc comments under 2.12 since it can't handle inner classes
if (scalaBinaryVersion.value == "2.12") Seq("-no-java-comments") else Seq.empty
},

// Implements -Xfatal-warnings, ignoring deprecation warnings.
// Code snippet taken from https://issues.scala-lang.org/browse/SI-8410.
compile in Compile := {
Expand Down Expand Up @@ -828,18 +843,7 @@ object TestSettings {
}
Seq.empty[File]
}).value,
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
// Remove certain packages from Scaladoc
scalacOptions in (Compile, doc) := Seq(
"-groups",
"-skip-packages", Seq(
"org.apache.spark.api.python",
"org.apache.spark.network",
"org.apache.spark.deploy",
"org.apache.spark.util.collection"
).mkString(":"),
"-doc-title", "Spark " + version.value.replaceAll("-SNAPSHOT", "") + " ScalaDoc"
)
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)
)

}

0 comments on commit 9f3407a

Please sign in to comment.