=pro #16704 add validatePullRequest task to samples
* move validatePullRequest to separate autoplugin * move MiMa settings to separate autoplugin
This commit is contained in:
parent
0b50d650f1
commit
d29c978871
5 changed files with 75 additions and 44 deletions
|
|
@ -16,15 +16,8 @@ import akka.Unidoc.unidocSettings
|
||||||
import com.typesafe.sbt.S3Plugin.S3
|
import com.typesafe.sbt.S3Plugin.S3
|
||||||
import com.typesafe.sbt.S3Plugin.s3Settings
|
import com.typesafe.sbt.S3Plugin.s3Settings
|
||||||
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
|
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
|
||||||
import com.typesafe.sbt.site.SphinxSupport
|
|
||||||
import com.typesafe.sbt.site.SphinxSupport.Sphinx
|
|
||||||
import com.typesafe.tools.mima.plugin.MimaKeys.binaryIssueFilters
|
|
||||||
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
|
|
||||||
import com.typesafe.tools.mima.plugin.MimaKeys.reportBinaryIssues
|
|
||||||
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
|
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
import sbt._
|
import sbt._
|
||||||
import sbtunidoc.Plugin.UnidocKeys.unidoc
|
|
||||||
|
|
||||||
object AkkaBuild extends Build {
|
object AkkaBuild extends Build {
|
||||||
System.setProperty("akka.mode", "test") // Is there better place for this?
|
System.setProperty("akka.mode", "test") // Is there better place for this?
|
||||||
|
|
@ -47,7 +40,7 @@ object AkkaBuild extends Build {
|
||||||
id = "akka",
|
id = "akka",
|
||||||
base = file("."),
|
base = file("."),
|
||||||
settings = parentSettings ++ Release.settings ++ unidocSettings ++
|
settings = parentSettings ++ Release.settings ++ unidocSettings ++
|
||||||
SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++ mimaSettings ++ scaladocSettings ++
|
SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++ scaladocSettings ++
|
||||||
GraphiteBuildEvents.settings ++ Protobuf.settings ++ Unidoc.settings(Seq(samples), Seq(remoteTests)) ++ Seq(
|
GraphiteBuildEvents.settings ++ Protobuf.settings ++ Unidoc.settings(Seq(samples), Seq(remoteTests)) ++ Seq(
|
||||||
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
|
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
|
||||||
Dist.distExclude := Seq(actorTests.id, docs.id, samples.id, osgi.id),
|
Dist.distExclude := Seq(actorTests.id, docs.id, samples.id, osgi.id),
|
||||||
|
|
@ -58,9 +51,7 @@ object AkkaBuild extends Build {
|
||||||
val downloads = d / "downloads"
|
val downloads = d / "downloads"
|
||||||
val archivesPathFinder = downloads * s"*$v.zip"
|
val archivesPathFinder = downloads * s"*$v.zip"
|
||||||
archivesPathFinder.get.map(file => (file -> ("akka/" + file.getName)))
|
archivesPathFinder.get.map(file => (file -> ("akka/" + file.getName)))
|
||||||
},
|
}
|
||||||
|
|
||||||
validatePullRequest <<= (unidoc in Compile, SphinxSupport.generate in Sphinx in docs) map { (_, _) => }
|
|
||||||
),
|
),
|
||||||
aggregate = Seq(actor, testkit, actorTests, remote, remoteTests, camel, cluster, clusterMetrics, slf4j, agent,
|
aggregate = Seq(actor, testkit, actorTests, remote, remoteTests, camel, cluster, clusterMetrics, slf4j, agent,
|
||||||
persistence, persistenceTck, kernel, osgi, docs, contrib, samples, multiNodeTestkit)
|
persistence, persistenceTck, kernel, osgi, docs, contrib, samples, multiNodeTestkit)
|
||||||
|
|
@ -73,7 +64,7 @@ object AkkaBuild extends Build {
|
||||||
// samples don't work with dbuild right now
|
// samples don't work with dbuild right now
|
||||||
aggregate = Seq(actor, testkit, actorTests, remote, remoteTests, camel, cluster, slf4j,
|
aggregate = Seq(actor, testkit, actorTests, remote, remoteTests, camel, cluster, slf4j,
|
||||||
persistence, persistenceTck, kernel, osgi, contrib, multiNodeTestkit)
|
persistence, persistenceTck, kernel, osgi, contrib, multiNodeTestkit)
|
||||||
)
|
).disablePlugins(ValidatePullRequest)
|
||||||
|
|
||||||
lazy val actor = Project(
|
lazy val actor = Project(
|
||||||
id = "akka-actor",
|
id = "akka-actor",
|
||||||
|
|
@ -96,7 +87,7 @@ object AkkaBuild extends Build {
|
||||||
id = "akka-bench-jmh",
|
id = "akka-bench-jmh",
|
||||||
base = file("akka-bench-jmh"),
|
base = file("akka-bench-jmh"),
|
||||||
dependencies = Seq(actor, persistence, testkit).map(_ % "compile;compile->test")
|
dependencies = Seq(actor, persistence, testkit).map(_ % "compile;compile->test")
|
||||||
)
|
).disablePlugins(ValidatePullRequest)
|
||||||
|
|
||||||
lazy val remote = Project(
|
lazy val remote = Project(
|
||||||
id = "akka-remote",
|
id = "akka-remote",
|
||||||
|
|
@ -219,7 +210,6 @@ object AkkaBuild extends Build {
|
||||||
base = file("akka-samples/akka-sample-osgi-dining-hakkers-maven-test"),
|
base = file("akka-samples/akka-sample-osgi-dining-hakkers-maven-test"),
|
||||||
settings = Seq(
|
settings = Seq(
|
||||||
publishArtifact := false,
|
publishArtifact := false,
|
||||||
reportBinaryIssues := (), // disable bin comp check
|
|
||||||
// force publication of artifacts to local maven repo, so latest versions can be used when running maven tests
|
// force publication of artifacts to local maven repo, so latest versions can be used when running maven tests
|
||||||
compile in Compile <<=
|
compile in Compile <<=
|
||||||
(publishM2 in actor, publishM2 in testkit, publishM2 in remote, publishM2 in cluster, publishM2 in osgi,
|
(publishM2 in actor, publishM2 in testkit, publishM2 in remote, publishM2 in cluster, publishM2 in osgi,
|
||||||
|
|
@ -246,8 +236,7 @@ object AkkaBuild extends Build {
|
||||||
lazy val baseSettings = Defaults.defaultSettings
|
lazy val baseSettings = Defaults.defaultSettings
|
||||||
|
|
||||||
lazy val parentSettings = baseSettings ++ Seq(
|
lazy val parentSettings = baseSettings ++ Seq(
|
||||||
publishArtifact := false,
|
publishArtifact := false
|
||||||
reportBinaryIssues := () // disable bin comp check
|
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val experimentalSettings = Seq(
|
lazy val experimentalSettings = Seq(
|
||||||
|
|
@ -290,7 +279,7 @@ object AkkaBuild extends Build {
|
||||||
pomIncludeRepository := (_ => false) // do not leak internal repositories during staging
|
pomIncludeRepository := (_ => false) // do not leak internal repositories during staging
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val defaultSettings = baseSettings ++ mimaSettings ++ resolverSettings ++ TestExtras.Filter.settings ++
|
lazy val defaultSettings = baseSettings ++ resolverSettings ++ TestExtras.Filter.settings ++
|
||||||
Protobuf.settings ++ Seq(
|
Protobuf.settings ++ Seq(
|
||||||
// compile options
|
// compile options
|
||||||
scalacOptions in Compile ++= Seq("-encoding", "UTF-8", "-target:jvm-1.6", "-deprecation", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint"),
|
scalacOptions in Compile ++= Seq("-encoding", "UTF-8", "-target:jvm-1.6", "-deprecation", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint"),
|
||||||
|
|
@ -337,32 +326,11 @@ object AkkaBuild extends Build {
|
||||||
|
|
||||||
// -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug".
|
// -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug".
|
||||||
// -a Show stack traces and exception class name for AssertionErrors.
|
// -a Show stack traces and exception class name for AssertionErrors.
|
||||||
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"),
|
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a")
|
||||||
|
|
||||||
validatePullRequestTask,
|
|
||||||
validatePullRequest <<= validatePullRequest.dependsOn(test in Test),
|
|
||||||
// add reportBinaryIssues to validatePullRequest on minor version maintenance branch
|
|
||||||
validatePullRequest <<= validatePullRequest.dependsOn(reportBinaryIssues)
|
|
||||||
) ++
|
) ++
|
||||||
mavenLocalResolverSettings ++
|
mavenLocalResolverSettings ++
|
||||||
JUnitFileReporting.settings ++ StatsDMetrics.settings
|
JUnitFileReporting.settings ++ StatsDMetrics.settings
|
||||||
|
|
||||||
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 := ()
|
|
||||||
|
|
||||||
lazy val mimaIgnoredProblems = {
|
|
||||||
Seq(
|
|
||||||
// add filters here, see release-2.3 branch
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
lazy val mimaSettings = mimaDefaultSettings ++ Seq(
|
|
||||||
// MiMa
|
|
||||||
previousArtifact := None,
|
|
||||||
binaryIssueFilters ++= mimaIgnoredProblems
|
|
||||||
)
|
|
||||||
|
|
||||||
def akkaPreviousArtifact(id: String): Def.Initialize[Option[sbt.ModuleID]] = Def.setting {
|
def akkaPreviousArtifact(id: String): Def.Initialize[Option[sbt.ModuleID]] = Def.setting {
|
||||||
if (enableMiMa) {
|
if (enableMiMa) {
|
||||||
// Note: This is a little gross because we don't have a 2.3.0 release on Scala 2.11.x
|
// Note: This is a little gross because we don't have a 2.3.0 release on Scala 2.11.x
|
||||||
|
|
|
||||||
26
project/MiMa.scala
Normal file
26
project/MiMa.scala
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
||||||
|
*/
|
||||||
|
package akka
|
||||||
|
|
||||||
|
import sbt._
|
||||||
|
import sbt.Keys._
|
||||||
|
import com.typesafe.tools.mima.plugin.MimaKeys.binaryIssueFilters
|
||||||
|
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
|
||||||
|
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
|
||||||
|
|
||||||
|
object MiMa extends AutoPlugin {
|
||||||
|
|
||||||
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
override val projectSettings = mimaDefaultSettings ++ Seq(
|
||||||
|
previousArtifact := None,
|
||||||
|
binaryIssueFilters ++= mimaIgnoredProblems
|
||||||
|
)
|
||||||
|
|
||||||
|
val mimaIgnoredProblems = {
|
||||||
|
Seq(
|
||||||
|
// add filters here, see release-2.3 branch
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,8 +3,20 @@
|
||||||
*/
|
*/
|
||||||
package akka
|
package akka
|
||||||
|
|
||||||
import sbt.AutoPlugin
|
import sbt._
|
||||||
|
import sbt.Keys._
|
||||||
|
import akka.ValidatePullRequest.validatePullRequest
|
||||||
|
import sbtunidoc.Plugin.UnidocKeys.unidoc
|
||||||
|
import com.typesafe.sbt.site.SphinxSupport
|
||||||
|
import com.typesafe.sbt.site.SphinxSupport.Sphinx
|
||||||
|
|
||||||
object RootSettings extends AutoPlugin {
|
object RootSettings extends AutoPlugin {
|
||||||
// settings for root project will go here
|
|
||||||
|
lazy val docs = ProjectRef(file("."), "akka-docs")
|
||||||
|
|
||||||
|
// settings for root project goes here
|
||||||
|
override val projectSettings = Seq(
|
||||||
|
validatePullRequest <<= validatePullRequest.dependsOn(unidoc in Compile),
|
||||||
|
validatePullRequest <<= validatePullRequest.dependsOn(SphinxSupport.generate in Sphinx in docs)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,11 @@ object Sample {
|
||||||
* transformed sample projects should have its settings added here.
|
* transformed sample projects should have its settings added here.
|
||||||
*/
|
*/
|
||||||
private val enableAutoPlugins = (project: Project) =>
|
private val enableAutoPlugins = (project: Project) =>
|
||||||
project.settings(
|
project.settings((
|
||||||
Publish.projectSettings: _*
|
MiMa.projectSettings ++
|
||||||
)
|
Publish.projectSettings ++
|
||||||
|
ValidatePullRequest.projectSettings
|
||||||
|
): _*)
|
||||||
|
|
||||||
private implicit class RichLoadedDefinitions(ld: LoadedDefinitions) {
|
private implicit class RichLoadedDefinitions(ld: LoadedDefinitions) {
|
||||||
def copy(projects: Seq[Project]) =
|
def copy(projects: Seq[Project]) =
|
||||||
|
|
|
||||||
23
project/ValidatePullRequest.scala
Normal file
23
project/ValidatePullRequest.scala
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
||||||
|
*/
|
||||||
|
package akka
|
||||||
|
|
||||||
|
import sbt._
|
||||||
|
import sbt.Keys._
|
||||||
|
import com.typesafe.tools.mima.plugin.MimaKeys.reportBinaryIssues
|
||||||
|
|
||||||
|
object ValidatePullRequest extends AutoPlugin {
|
||||||
|
|
||||||
|
val validatePullRequest = taskKey[Unit]("Additional tasks for pull request validation")
|
||||||
|
|
||||||
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
override lazy val projectSettings = Seq(
|
||||||
|
validatePullRequest := (),
|
||||||
|
validatePullRequest <<= validatePullRequest.dependsOn(test in Test),
|
||||||
|
|
||||||
|
// add reportBinaryIssues to validatePullRequest on minor version maintenance branch
|
||||||
|
validatePullRequest <<= validatePullRequest.dependsOn(reportBinaryIssues)
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue