=pro upgrade to latest sbt and add first auto plugins
* RootSettings plugin contains settings for root project * other auto plugins that are meant only for root project depend on RootSettings * other auto plugins that are meant for every project are enabled by default reducing boilerplate
This commit is contained in:
parent
338f61886e
commit
22334da2a1
26 changed files with 117 additions and 101 deletions
|
|
@ -71,7 +71,7 @@ Whether or not a pull request (or parts of it) shall be back- or forward-ported
|
||||||
|
|
||||||
## Continuous Integration
|
## Continuous Integration
|
||||||
|
|
||||||
Each project should be configured to use a continuous integration (CI) tool (i.e. a build server à la Jenkins). Typesafe has a Jenkins server farm that can be used. The CI tool should, on each push to master, build the **full** distribution and run **all** tests, and if something fails it should email out a notification with the failure report to the committer and the core team. The CI tool should also be used in conjunction with Typesafe’s Pull Request Validator (discussed below).
|
Each project should be configured to use a continuous integration (CI) tool (i.e. a build server à la Jenkins). Typesafe has a [Jenkins server farm](https://jenkins.akka.io/) that can be used. The CI tool should, on each push to master, build the **full** distribution and run **all** tests, and if something fails it should email out a notification with the failure report to the committer and the core team. The CI tool should also be used in conjunction with a Pull Request validator (discussed below).
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|
@ -143,8 +143,16 @@ Example:
|
||||||
|
|
||||||
## How To Enforce These Guidelines?
|
## How To Enforce These Guidelines?
|
||||||
|
|
||||||
### Make Use Of Typesafe’s Pull Request Validator
|
### Make Use of Pull Request Validator
|
||||||
It is recommended to set up the project to use Typesafe’s [Pull Request Validator](https://github.com/typesafehub/ghpullrequest-validator) that automatically merges the code, builds it, runs the tests and comments on the Pull Request in GitHub.
|
Akka uses [Jenkins GitHub pull request builder plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin) that automatically merges the code, builds it, runs the tests and comments on the Pull Request in GitHub.
|
||||||
|
|
||||||
|
Upon a submission of a Pull Request the Github pull request builder plugin will post a following comment:
|
||||||
|
|
||||||
|
Can one of the repo owners verify this patch?
|
||||||
|
|
||||||
|
This requires a member from a core team to start Pull Request validation process by posting comment consisting only of `OK TO TEST`. From now on, whenever new commits are pushed to the Pull Request, a validation job will be automaticaly started and the results of the validation posted to the Pull Request.
|
||||||
|
|
||||||
|
A Pull Request validation job can be started manually by posting `TEST THIS PLEASE` comment on the Pull Request.
|
||||||
|
|
||||||
## Source style
|
## Source style
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
sbt.version=0.13.7
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
sbt.version=0.13.7
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.1
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
1
build.sbt
Normal file
1
build.sbt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
enablePlugins(akka.RootSettings)
|
||||||
|
|
@ -40,11 +40,10 @@ object AkkaBuild extends Build {
|
||||||
lazy val root = Project(
|
lazy val root = Project(
|
||||||
id = "akka",
|
id = "akka",
|
||||||
base = file("."),
|
base = file("."),
|
||||||
settings = parentSettings ++ Release.settings ++ unidocSettings ++ Publish.versionSettings ++
|
settings = parentSettings ++ Release.settings ++ unidocSettings ++
|
||||||
SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++ mimaSettings ++ scaladocSettings ++
|
SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++ mimaSettings ++ 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,
|
||||||
Publish.defaultPublishTo in ThisBuild <<= crossTarget / "repository",
|
|
||||||
Dist.distExclude := Seq(actorTests.id, docs.id, samples.id, osgi.id),
|
Dist.distExclude := Seq(actorTests.id, docs.id, samples.id, osgi.id),
|
||||||
|
|
||||||
S3.host in S3.upload := "downloads.typesafe.com.s3.amazonaws.com",
|
S3.host in S3.upload := "downloads.typesafe.com.s3.amazonaws.com",
|
||||||
|
|
@ -231,7 +230,7 @@ object AkkaBuild extends Build {
|
||||||
) ++
|
) ++
|
||||||
resolverSettings
|
resolverSettings
|
||||||
|
|
||||||
lazy val baseSettings = Defaults.defaultSettings ++ Publish.settings
|
lazy val baseSettings = Defaults.defaultSettings
|
||||||
|
|
||||||
lazy val parentSettings = baseSettings ++ Seq(
|
lazy val parentSettings = baseSettings ++ Seq(
|
||||||
publishArtifact := false,
|
publishArtifact := false,
|
||||||
|
|
|
||||||
|
|
@ -1,99 +1,61 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
||||||
|
*/
|
||||||
package akka
|
package akka
|
||||||
|
|
||||||
import sbt._
|
import sbt._
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
import sbt.Project.Initialize
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
object Publish {
|
object Publish extends AutoPlugin {
|
||||||
final val Snapshot = "-SNAPSHOT"
|
|
||||||
|
|
||||||
val defaultPublishTo = SettingKey[File]("default-publish-to")
|
val defaultPublishTo = settingKey[File]("Default publish directory")
|
||||||
|
|
||||||
lazy val settings = Seq(
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
override lazy val projectSettings = Seq(
|
||||||
crossPaths := false,
|
crossPaths := false,
|
||||||
pomExtra := akkaPomExtra,
|
pomExtra := akkaPomExtra,
|
||||||
publishTo <<= akkaPublishTo,
|
publishTo := akkaPublishTo.value,
|
||||||
credentials ++= akkaCredentials,
|
credentials ++= akkaCredentials,
|
||||||
organizationName := "Typesafe Inc.",
|
organizationName := "Typesafe Inc.",
|
||||||
organizationHomepage := Some(url("http://www.typesafe.com")),
|
organizationHomepage := Some(url("http://www.typesafe.com")),
|
||||||
publishMavenStyle := true,
|
publishMavenStyle := true,
|
||||||
// Maven central cannot allow other repos.
|
pomIncludeRepository := { x => false },
|
||||||
// TODO - Make sure all artifacts are on central.
|
defaultPublishTo := crossTarget.value / "repository"
|
||||||
pomIncludeRepository := { x => false }
|
|
||||||
)
|
|
||||||
|
|
||||||
lazy val versionSettings = Seq(
|
|
||||||
commands += stampVersion
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def akkaPomExtra = {
|
def akkaPomExtra = {
|
||||||
(<inceptionYear>2009</inceptionYear>
|
<inceptionYear>2009</inceptionYear>
|
||||||
<scm>
|
<scm>
|
||||||
<url>git://github.com/akka/akka.git</url>
|
<url>git://github.com/akka/akka.git</url>
|
||||||
<connection>scm:git:git@github.com:akka/akka.git</connection>
|
<connection>scm:git:git@github.com:akka/akka.git</connection>
|
||||||
</scm>) ++ makeDevelopersXml(Map(
|
</scm>
|
||||||
"jboner" -> "Jonas Boner",
|
|
||||||
"viktorklang" -> "Viktor Klang",
|
|
||||||
"rkuhn" -> "Roland Kuhn",
|
|
||||||
"pvlugter" -> "Peter Vlugter"
|
|
||||||
// TODO - More than the names in the last 10 commits
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private[this] def makeDevelopersXml(users: Map[String,String]) =
|
|
||||||
<developers>
|
<developers>
|
||||||
{
|
<developer>
|
||||||
for((id, user) <- users)
|
<id>akka-contributors</id>
|
||||||
yield <developer><id>{id}</id><name>{user}</name></developer>
|
<name>Akka Contributors</name>
|
||||||
}
|
<email>akka-dev@googlegroups.com</email>
|
||||||
|
<url>https://github.com/akka/akka/graphs/contributors</url>
|
||||||
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
|
|
||||||
def sonatypePublishTo: Initialize[Option[Resolver]] = {
|
|
||||||
version { v: String =>
|
|
||||||
val nexus = "https://oss.sonatype.org/"
|
|
||||||
if (v.trim.endsWith("SNAPSHOT")) Some("snapshots" at nexus + "content/repositories/snapshots")
|
|
||||||
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def akkaPublishTo: Initialize[Option[Resolver]] = {
|
private def akkaPublishTo = Def.setting {
|
||||||
(defaultPublishTo, version) { (defaultPT, v) =>
|
sonatypeRepo(version.value) orElse localRepo(defaultPublishTo.value)
|
||||||
akkaPublishRepository orElse
|
|
||||||
sonatypeRepo(v) orElse
|
|
||||||
Some(Resolver.file("Default Local Repository", defaultPT))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def sonatypeRepo(version: String): Option[Resolver] = {
|
private def sonatypeRepo(version: String): Option[Resolver] =
|
||||||
Option(sys.props("publish.maven.central")) filter (_.toLowerCase == "true") map { _ =>
|
Option(sys.props("publish.maven.central")) filter (_.toLowerCase == "true") map { _ =>
|
||||||
val nexus = "https://oss.sonatype.org/"
|
val nexus = "https://oss.sonatype.org/"
|
||||||
if(version endsWith "-SNAPSHOT") ("snapshots" at nexus + "content/repositories/snapshots")
|
if (version endsWith "-SNAPSHOT") "snapshots" at nexus + "content/repositories/snapshots"
|
||||||
else ("releases" at nexus + "service/local/staging/deploy/maven2")
|
else "releases" at nexus + "service/local/staging/deploy/maven2"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def akkaPublishRepository: Option[Resolver] =
|
private def localRepo(repository: File) =
|
||||||
Option(System.getProperty("akka.publish.repository", null)) map { "Akka Publish Repository" at _ }
|
Some(Resolver.file("Default Local Repository", repository))
|
||||||
|
|
||||||
def akkaCredentials: Seq[Credentials] =
|
private def akkaCredentials: Seq[Credentials] =
|
||||||
Option(System.getProperty("akka.publish.credentials", null)) map (f => Credentials(new File(f))) toSeq
|
Option(System.getProperty("akka.publish.credentials", null)).map(f => Credentials(new File(f))).toSeq
|
||||||
|
|
||||||
// timestamped versions
|
|
||||||
|
|
||||||
def stampVersion = Command.command("stamp-version") { state =>
|
|
||||||
val extracted = Project.extract(state)
|
|
||||||
extracted.append(List(version in ThisBuild ~= stamp), state)
|
|
||||||
}
|
|
||||||
|
|
||||||
def stamp(version: String): String = {
|
|
||||||
if (version endsWith Snapshot) (version stripSuffix Snapshot) + "-" + timestamp(System.currentTimeMillis)
|
|
||||||
else version
|
|
||||||
}
|
|
||||||
|
|
||||||
def timestamp(time: Long): String = {
|
|
||||||
val format = new java.text.SimpleDateFormat("yyyyMMdd-HHmmss")
|
|
||||||
format.format(new java.util.Date(time))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
project/RootSettings.scala
Normal file
10
project/RootSettings.scala
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
||||||
|
*/
|
||||||
|
package akka
|
||||||
|
|
||||||
|
import sbt.AutoPlugin
|
||||||
|
|
||||||
|
object RootSettings extends AutoPlugin {
|
||||||
|
// settings for root project will go here
|
||||||
|
}
|
||||||
34
project/TimeStampede.scala
Normal file
34
project/TimeStampede.scala
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
||||||
|
*/
|
||||||
|
package akka
|
||||||
|
|
||||||
|
import sbt._
|
||||||
|
import sbt.Keys._
|
||||||
|
|
||||||
|
object TimeStampede extends AutoPlugin {
|
||||||
|
|
||||||
|
override def requires = RootSettings
|
||||||
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
override lazy val projectSettings = Seq(
|
||||||
|
commands += stampVersion
|
||||||
|
)
|
||||||
|
|
||||||
|
final val Snapshot = "-SNAPSHOT"
|
||||||
|
|
||||||
|
def stampVersion = Command.command("stampVersion") { state =>
|
||||||
|
val extracted = Project.extract(state)
|
||||||
|
extracted.append(List(version in ThisBuild ~= stamp), state)
|
||||||
|
}
|
||||||
|
|
||||||
|
def stamp(version: String): String = {
|
||||||
|
if (version endsWith Snapshot) (version stripSuffix Snapshot) + "-" + timestamp(System.currentTimeMillis)
|
||||||
|
else version
|
||||||
|
}
|
||||||
|
|
||||||
|
def timestamp(time: Long): String = {
|
||||||
|
val format = new java.text.SimpleDateFormat("yyyyMMdd-HHmmss")
|
||||||
|
format.format(new java.util.Date(time))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.5
|
sbt.version=0.13.7
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue