aboutsummaryrefslogtreecommitdiff
path: root/project/SparkBuild.scala
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2016-03-16 23:02:25 -0700
committerReynold Xin <rxin@databricks.com>2016-03-16 23:02:25 -0700
commit82066a166768399eada42f3d65150becf43320b3 (patch)
tree3d4b9519cfbe4372af27ccfb0b10b5ab37bdf3ea /project/SparkBuild.scala
parent5faba9faccb5ce43790c43284769e0f890340606 (diff)
downloadspark-82066a166768399eada42f3d65150becf43320b3.tar.gz
spark-82066a166768399eada42f3d65150becf43320b3.tar.bz2
spark-82066a166768399eada42f3d65150becf43320b3.zip
[SPARK-13948] MiMa check should catch if the visibility changes to private
MiMa excludes are currently generated using both the current Spark version's classes and Spark 1.2.0's classes, but this doesn't make sense: we should only be ignoring classes which were `private` in the previous Spark version, not classes which became private in the current version. This patch updates `dev/mima` to only generate excludes with respect to the previous artifacts that MiMa checks against. It also updates `MimaBuild` so that `excludeClass` only applies directly to the class being excluded and not to its companion object (since a class and its companion object can have different accessibility). Author: Josh Rosen <joshrosen@databricks.com> Closes #11774 from JoshRosen/SPARK-13948.
Diffstat (limited to 'project/SparkBuild.scala')
-rw-r--r--project/SparkBuild.scala24
1 files changed, 14 insertions, 10 deletions
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index f76cda08ec..dbe98d1e14 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -26,6 +26,7 @@ import sbt.Classpaths.publishTask
import sbt.Keys._
import sbtunidoc.Plugin.UnidocKeys.unidocGenjavadocVersion
import com.typesafe.sbt.pom.{PomBuild, SbtPomKeys}
+import com.typesafe.tools.mima.plugin.MimaKeys
import spray.revolver.RevolverPlugin._
@@ -247,12 +248,14 @@ object SparkBuild extends PomBuild {
/* Enable tests settings for all projects except examples, assembly and tools */
(allProjects ++ optionallyEnabledProjects).foreach(enable(TestSettings.settings))
- allProjects.filterNot { x =>
+ val mimaProjects = allProjects.filterNot { x =>
Seq(
spark, hive, hiveThriftServer, catalyst, repl, networkCommon, networkShuffle, networkYarn,
unsafe, testTags, sketch
).contains(x)
- }.foreach { x =>
+ }
+
+ mimaProjects.foreach { x =>
enable(MimaBuild.mimaSettings(sparkHome, x))(x)
}
@@ -371,22 +374,23 @@ object ExcludedDependencies {
}
/**
- * Following project only exists to pull previous artifacts of Spark for generating
- * Mima ignores. For more information see: SPARK 2071
+ * Project to pull previous artifacts of Spark for generating Mima excludes.
*/
object OldDeps {
lazy val project = Project("oldDeps", file("dev"), settings = oldDepsSettings)
+ lazy val allPreviousArtifactKeys = Def.settingDyn[Seq[Option[ModuleID]]] {
+ SparkBuild.mimaProjects
+ .map { project => MimaKeys.previousArtifact in project }
+ .map(k => Def.setting(k.value))
+ .join
+ }
+
def oldDepsSettings() = Defaults.coreDefaultSettings ++ Seq(
name := "old-deps",
scalaVersion := "2.10.5",
- libraryDependencies := Seq(
- "spark-streaming",
- "spark-mllib",
- "spark-graphx",
- "spark-core"
- ).map(id => "org.apache.spark" % (id + "_2.11") % "1.2.0")
+ libraryDependencies := allPreviousArtifactKeys.value.flatten
)
}