From c13415b0348bc65b7da5d8bfa873f32cc482932f Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Tue, 27 Aug 2013 16:17:22 +0200 Subject: [PATCH] =pro #3558 Add validate-pull-request task --- project/AkkaBuild.scala | 51 ++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 8dbd2d2850..7f87395101 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -13,6 +13,7 @@ import com.typesafe.sbt.SbtScalariform.ScalariformKeys import com.typesafe.sbtosgi.OsgiPlugin.{ OsgiKeys, osgiSettings } import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact +import com.typesafe.tools.mima.plugin.MimaKeys.reportBinaryIssues import com.typesafe.sbt.SbtSite.site import com.typesafe.sbt.site.SphinxSupport import com.typesafe.sbt.site.SphinxSupport.{ enableOutput, generatePdf, generatedPdf, generateEpub, generatedEpub, sphinxInputs, sphinxPackages, Sphinx } @@ -183,7 +184,8 @@ object AkkaBuild extends Build { settings = defaultSettings ++ scaladocSettings ++ Seq( publishArtifact in Compile := false, libraryDependencies ++= Dependencies.actorTests, - testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") + testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"), + reportBinaryIssues := () // disable bin comp check ) ) @@ -221,7 +223,7 @@ object AkkaBuild extends Build { }, scalatestOptions in MultiJvm := defaultMultiJvmScalatestOptions, publishArtifact in Compile := false, - previousArtifact := akkaPreviousArtifact("akka-remote-tests") + reportBinaryIssues := () // disable bin comp check ) ) configs (MultiJvm) @@ -330,7 +332,8 @@ object AkkaBuild extends Build { dependencies = Seq(actor, slf4j, testkit % "test->test"), settings = defaultSettings ++ scaladocSettings ++ javadocSettings ++ OSGi.camel ++ Seq( libraryDependencies ++= Dependencies.camel, - testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") + testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"), + previousArtifact := akkaPreviousArtifact("akka-camel") ) ) @@ -394,7 +397,8 @@ object AkkaBuild extends Build { ActorOsgiConfigurationReference <<= ActorOsgiConfigurationReferenceAction(projects.filter(p => !p.id.contains("test") && !p.id.contains("sample"))), ActorMakeOsgiConfiguration <<= (ActorOsgiConfigurationReference, resourceManaged in Compile, streams) map makeOsgiConfigurationFiles, resourceGenerators in Compile <+= ActorMakeOsgiConfiguration, - parallelExecution in Test := false + parallelExecution in Test := false, + reportBinaryIssues := () // disable bin comp check ) ) @@ -404,7 +408,8 @@ object AkkaBuild extends Build { dependencies = Seq(osgi % "compile;test->test"), settings = defaultSettings ++ scaladocSettings ++ javadocSettings ++ OSGi.osgiAries ++ Seq( libraryDependencies ++= Dependencies.osgiAries, - parallelExecution in Test := false + parallelExecution in Test := false, + reportBinaryIssues := () // disable bin comp check ) ) @@ -417,7 +422,8 @@ object AkkaBuild extends Build { publishTo <<= Publish.akkaPluginPublishTo, scalacOptions in Compile := Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"), scalaVersion := "2.9.2", - scalaBinaryVersion <<= scalaVersion + scalaBinaryVersion <<= scalaVersion, + reportBinaryIssues := () // disable bin comp check ) ) @@ -582,7 +588,8 @@ object AkkaBuild extends Build { libraryDependencies ++= Dependencies.docs, publishArtifact in Compile := false, unmanagedSourceDirectories in ScalariformKeys.format in Test <<= unmanagedSourceDirectories in Test, - testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") + testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"), + reportBinaryIssues := () // disable bin comp check ) ) @@ -593,6 +600,7 @@ object AkkaBuild extends Build { settings = defaultSettings ++ scaladocSettings ++ javadocSettings ++ multiJvmSettings ++ Seq( libraryDependencies ++= Dependencies.contrib, testOptions += Tests.Argument(TestFrameworks.JUnit, "-v"), + reportBinaryIssues := (), // disable bin comp check description := """| |This subproject provides a home to modules contributed by external |developers which may or may not move into the officially supported code @@ -611,7 +619,8 @@ object AkkaBuild extends Build { base = file("akka-channels"), dependencies = Seq(actor), settings = defaultSettings ++ scaladocSettings ++ experimentalSettings ++ Seq( - libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-reflect" % _) + libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-reflect" % _), + reportBinaryIssues := () // disable bin comp check ) ) @@ -621,7 +630,8 @@ object AkkaBuild extends Build { dependencies = Seq(channels, testkit % "compile;test->test"), settings = defaultSettings ++ experimentalSettings ++ Seq( publishArtifact in Compile := false, - libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-compiler" % _) + libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-compiler" % _), + reportBinaryIssues := () // disable bin comp check ) ) @@ -637,11 +647,13 @@ object AkkaBuild extends Build { lazy val baseSettings = Defaults.defaultSettings ++ Publish.settings lazy val parentSettings = baseSettings ++ Seq( - publishArtifact := false + publishArtifact := false, + reportBinaryIssues := () // disable bin comp check ) lazy val sampleSettings = defaultSettings ++ Seq( - publishArtifact in (Compile, packageBin) := false + publishArtifact in (Compile, packageBin) := false, + reportBinaryIssues := () // disable bin comp check ) lazy val experimentalSettings = Seq( @@ -772,9 +784,16 @@ object AkkaBuild extends Build { }, // show full stack traces and test case durations - testOptions in Test += Tests.Argument("-oDF") + testOptions in Test += Tests.Argument("-oDF"), + + validatePullRequestTask, + validatePullRequest <<= validatePullRequest.dependsOn(/* reportBinaryIssues */) ) + val validatePullRequest = TaskKey[Unit]("validate-pull-request", "Additional tasks for pull request validation") + // the tasks that to run for validation is defined in defaultSettings + val validatePullRequestTask = validatePullRequest := () + // preprocessing settings for sphinx lazy val sphinxPreprocessing = inConfig(Sphinx)(Seq( target in preprocess <<= baseDirectory / "rst_preprocessed", @@ -900,8 +919,12 @@ object AkkaBuild extends Build { previousArtifact := None ) - def akkaPreviousArtifact(id: String, organization: String = "com.typesafe.akka", version: String = "2.0"): Option[sbt.ModuleID] = - if (enableMiMa) Some(organization % id % version) // the artifact to compare binary compatibility with + def akkaPreviousArtifact(id: String, organization: String = "com.typesafe.akka", version: String = "2.2.0", + crossVersion: String = "2.10"): Option[sbt.ModuleID] = + if (enableMiMa) { + val fullId = if (crossVersion.isEmpty) id else id + "_" + crossVersion + Some(organization % fullId % version) // the artifact to compare binary compatibility with + } else None def loadSystemProperties(fileName: String): Unit = {