Various streams build improvements

* remove settings duplication between AkkaBuild and project specific .sbt files
* do not publish test projects
* run akka-http-core tests
* fix lambda sample project versions
* remove obsolete projects (streamAndHttp, httpParent, docsDev)
* exclude parsing project from unidoc
* update to the latest sbt
This commit is contained in:
Martynas Mickevičius 2016-01-18 18:16:30 +02:00
parent 70ff55ac36
commit 7743aa9d0a
25 changed files with 62 additions and 193 deletions

View file

@ -1,11 +1,6 @@
import akka.{ AkkaBuild, Dependencies, Formatting }
AkkaBuild.defaultSettings
Formatting.formatSettings
publishArtifact in Compile := false
Dependencies.actorTests
AkkaBuild.dontPublishSettings
Formatting.formatSettings
Dependencies.actorTests

View file

@ -43,7 +43,7 @@ class IncludeCode2(Directive):
encoding = self.options.get('encoding', env.config.source_encoding)
codec_info = codecs.lookup(encoding)
try:
f = codecs.StreamReaderWriter(open(fn, 'U'),
f = codecs.StreamReaderWriter(open(fn, 'Ub'),
codec_info[2], codec_info[3], 'strict')
lines = f.readlines()
f.close()

View file

@ -2,13 +2,8 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.httpCore
Dependencies.httpCore
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-http-core").value
disablePlugins(Unidoc) // TODO remove me

View file

@ -2,12 +2,8 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.httpJackson
Dependencies.httpJackson
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-http-jackson").value

View file

@ -2,11 +2,8 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.httpSprayJson
Dependencies.httpSprayJson
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-http-spray-json").value

View file

@ -2,11 +2,8 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.httpXml
Dependencies.httpXml
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-http-xml").value

View file

@ -2,11 +2,10 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.httpTestkit
Dependencies.httpTestkit
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-http-testkit").value
scalacOptions in Compile += "-language:postfixOps"

View file

@ -1,8 +1,13 @@
import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.dontPublishSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
Dependencies.httpTests
// don't ignore Suites which is the default for the junit-interface
testOptions += Tests.Argument(TestFrameworks.JUnit, "--ignore-runners=")
scalacOptions in Compile += "-language:_"
mainClass in run in Test := Some("akka.http.javadsl.SimpleServerApp")

View file

@ -3,13 +3,11 @@ import com.typesafe.tools.mima.plugin.MimaKeys
import spray.boilerplate.BoilerplatePlugin._
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.http
Dependencies.http
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-http").value
Boilerplate.settings
scalacOptions in Compile += "-language:_"

View file

@ -40,7 +40,7 @@ private[http] final case class RequestContextImpl(underlying: ScalaRequestContex
case MarshallerImpl(m)
implicit val marshaller = m(underlying.executionContext)
underlying.complete(value)
case _ throw new IllegalArgumentException("Unsupported marshaller: $marshaller")
case _ throw new IllegalArgumentException(s"Unsupported marshaller: $marshaller")
}
def complete(response: jm.HttpResponse): RouteResult = underlying.complete(response.asScala)

View file

@ -1,22 +1,18 @@
import akka._
import akka.ValidatePullRequest._
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import com.typesafe.sbt.SbtSite.site
import com.typesafe.sbt.site.SphinxSupport._
import com.typesafe.tools.mima.plugin.MimaKeys
enablePlugins(ScaladocNoVerificationOfDiagrams)
AkkaBuild.defaultSettings
AkkaBuild.dontPublishSettings
AkkaBuild.experimentalSettings
Formatting.docFormatSettings
site.settings
OSGi.parsing
Dependencies.parsing
unmanagedSourceDirectories in ScalariformKeys.format in Test <<= unmanagedSourceDirectories in Test
scalacOptions += "-language:_"
AkkaBuild.dontPublishSettings
// ScalaDoc doesn't like the macros
sources in doc in Compile := List()
enablePlugins(ScaladocNoVerificationOfDiagrams)

View file

@ -1,10 +1,9 @@
name := "akka-sample-main-java-lambda"
version := "1.0"
version := "2.4-SNAPSHOT"
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT"
)

View file

@ -7,7 +7,7 @@
<artifactId>akka-sample-main-java-lambda</artifactId>
<groupId>com.typesafe.akka.samples</groupId>
<name>Akka Main in Java</name>
<version>1.0</version>
<version>2.4-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View file

@ -1,6 +1,6 @@
name := "akka-sample-persistence-java-lambda"
version := "1.0"
version := "2.4-SNAPSHOT"
scalaVersion := "2.11.7"
@ -13,4 +13,3 @@ libraryDependencies ++= Seq(
"org.iq80.leveldb" % "leveldb" % "0.7",
"org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8"
)

View file

@ -1,6 +1,6 @@
name := "akka-supervision-java-lambda"
version := "1.0"
version := "2.4-SNAPSHOT"
scalaVersion := "2.11.7"

View file

@ -11,7 +11,7 @@
<groupId>sample</groupId>
<artifactId>akka-supervision-java-lambda</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<version>2.4-SNAPSHOT</version>
<dependencies>
<dependency>

View file

@ -1 +0,0 @@
enablePlugins(akka.UnidocRoot, akka.TimeStampede, akka.UnidocWithPrValidation)

View file

@ -2,11 +2,8 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.streamTestkit
Dependencies.streamTestkit
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-stream-testkit").value

View file

@ -2,7 +2,6 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
Dependencies.streamTestsTck

View file

@ -2,7 +2,7 @@ import akka._
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.dontPublishSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
Dependencies.streamTests

View file

@ -3,13 +3,9 @@ import com.typesafe.tools.mima.plugin.MimaKeys
import spray.boilerplate.BoilerplatePlugin._
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings
OSGi.stream
Dependencies.stream
MimaKeys.previousArtifacts := akkaStreamAndHttpPreviousArtifacts("akka-stream").value
Boilerplate.settings

View file

@ -2,7 +2,5 @@ import akka.{ AkkaBuild, Formatting, OSGi, Dependencies }
import com.typesafe.tools.mima.plugin.MimaKeys
AkkaBuild.defaultSettings
AkkaBuild.experimentalSettings
Formatting.formatSettings

View file

@ -45,15 +45,6 @@ object AkkaBuild extends Build {
Protobuf.settings ++ Seq(
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean,
Dist.distExclude := Seq(actorTests.id, docs.id, samples.id, osgi.id),
// FIXME problem with scalaunidoc:doc, there must be a better way
unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject -- inProjects(protobuf, samples,
sampleCamelJava, sampleCamelScala, sampleClusterJava, sampleClusterScala, sampleFsmScala, sampleFsmJavaLambda,
sampleMainJava, sampleMainScala, sampleMainJavaLambda, sampleMultiNodeScala,
samplePersistenceJava, samplePersistenceScala, samplePersistenceJavaLambda,
sampleRemoteJava, sampleRemoteScala, sampleSupervisionJavaLambda,
sampleDistributedDataScala, sampleDistributedDataJava),
S3.host in S3.upload := "downloads.typesafe.com.s3.amazonaws.com",
S3.progress in S3.upload := true,
mappings in S3.upload <<= (Release.releaseDirectory, version) map { (d, v) =>
@ -67,8 +58,7 @@ object AkkaBuild extends Build {
slf4j, agent, persistence, persistenceQuery, persistenceTck, kernel, osgi, docs, contrib, samples, multiNodeTestkit, benchJmh, typed, protobuf,
// streamAndHttp, // does not seem to work
stream, streamTestkit, streamTests, streamTestsTck,
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests, httpTestkit,
docsDev // TODO merge with `docs`
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests, httpTestkit
)
)
@ -82,8 +72,7 @@ object AkkaBuild extends Build {
slf4j, persistence, persistenceQuery, persistenceTck, kernel, osgi, contrib, multiNodeTestkit, benchJmh, typed, protobuf,
// streamAndHttp, // does not seem to work
stream, streamTestkit, streamTests, streamTestsTck,
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests, httpTestkit,
docsDev // TODO merge with `docs`
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests, httpTestkit
)
).disablePlugins(ValidatePullRequest)
@ -213,103 +202,34 @@ object AkkaBuild extends Build {
dependencies = Seq(persistence % "compile;provided->provided;test->test", testkit % "compile;test->test")
)
lazy val streamAndHttp = Project(
id = "akka-stream-and-http-experimental",
base = file("akka-stream-and-http"),
settings = parentSettings ++ Release.settings ++
SphinxDoc.akkaSettings ++
Dist.settings ++
Protobuf.settings ++ Seq(
Dist.distExclude := Seq(),
// testMailbox in GlobalScope := System.getProperty("akka.testMailbox", "false").toBoolean,
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
Publish.defaultPublishTo in ThisBuild <<= crossTarget / "repository"
// javacOptions in JavaDoc ++= Seq("-Xdoclint:none"), TODO likely still needed
// artifactName in packageDoc in JavaDoc := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"),
// packageDoc in Compile <<= packageDoc in JavaDoc,
// // generate online version of docs
// sphinxInputs in Sphinx <<= sphinxInputs in Sphinx in LocalProject(docsDev.id) map { inputs => inputs.copy(tags = inputs.tags :+ "online") },
// // don't regenerate the pdf, just reuse the akka-docs version
// generatedPdf in Sphinx <<= generatedPdf in Sphinx in LocalProject(docsDev.id) map identity,
// generatedEpub in Sphinx <<= generatedEpub in Sphinx in LocalProject(docsDev.id) map identity,
// publishArtifact in packageSite := false
),
aggregate = Seq(parsing, stream, streamTestkit, streamTests, streamTestsTck, httpParent)
)
lazy val httpParent = Project(
id = "akka-http-parent-experimental",
base = file("akka-http-parent"),
settings = parentSettings,
aggregate = Seq(
httpCore,
http,
httpTestkit,
httpTests,
httpMarshallersScala, httpMarshallersJava
)
)
lazy val httpCore = Project(
id = "akka-http-core-experimental",
base = file("akka-http-core"),
dependencies = Seq(stream, parsing, streamTestkit % "test->test"),
settings = defaultSettings
).disablePlugins(Unidoc) // TODO remove me
dependencies = Seq(stream, parsing, streamTestkit % "test->test")
)
lazy val http = Project(
id = "akka-http-experimental",
base = file("akka-http"),
dependencies = Seq(httpCore),
settings =
defaultSettings ++
Seq(
scalacOptions in Compile += "-language:_"
)
dependencies = Seq(httpCore)
)
lazy val streamTestkit = Project(
id = "akka-stream-testkit",
base = file("akka-stream-testkit"), // TODO that persistence dependency
dependencies = Seq(stream, persistence % "compile;provided->provided;test->test", testkit % "compile;test->test"),
settings = defaultSettings ++ experimentalSettings
dependencies = Seq(stream, persistence % "compile;provided->provided;test->test", testkit % "compile;test->test")
)
lazy val httpTestkit = Project(
id = "akka-http-testkit-experimental",
base = file("akka-http-testkit"),
dependencies = Seq(http, streamTestkit),
settings =
defaultSettings ++ Seq(
scalacOptions in Compile += "-language:_"
)
dependencies = Seq(http, streamTestkit)
)
lazy val httpTests = Project(
id = "akka-http-tests-experimental",
base = file("akka-http-tests"),
dependencies = Seq(httpTestkit % "test", httpSprayJson, httpXml, httpJackson),
settings =
defaultSettings ++ Seq(
publishArtifact := false,
scalacOptions in Compile += "-language:_",
// test discovery is broken when sbt isn't run with a Java 8 compatible JVM, so we define a single
// Suite where all tests need to be registered
definedTests in Test := {
def pseudoJUnitRunWithFingerprint =
// we emulate a junit-interface fingerprint here which cannot be accessed statically
new sbt.testing.AnnotatedFingerprint {
def annotationName = "org.junit.runner.RunWith"
def isModule = false
}
Seq(new TestDefinition("AllJavaTests", pseudoJUnitRunWithFingerprint, false, Array.empty))
},
// don't ignore Suites which is the default for the junit-interface
testOptions += Tests.Argument(TestFrameworks.JUnit, "--ignore-runners="),
mainClass in run in Test := Some("akka.http.javadsl.SimpleServerApp")
)
dependencies = Seq(httpTestkit % "test", httpSprayJson, httpXml, httpJackson)
)
lazy val httpMarshallersScala = Project(
@ -323,13 +243,11 @@ object AkkaBuild extends Build {
lazy val httpSprayJson =
httpMarshallersScalaSubproject("spray-json")
.settings(Dependencies.httpSprayJson)
.settings(OSGi.httpSprayJson: _*)
lazy val httpMarshallersJava = Project(
id = "akka-http-marshallers-java-experimental",
base = file("akka-http-marshallers-java"),
settings = defaultSettings ++ parentSettings
settings = parentSettings
).aggregate(httpJackson)
lazy val httpJackson =
@ -339,47 +257,37 @@ object AkkaBuild extends Build {
Project(
id = s"akka-http-$name-experimental",
base = file(s"akka-http-marshallers-scala/akka-http-$name"),
dependencies = Seq(http),
settings = defaultSettings
dependencies = Seq(http)
)
def httpMarshallersJavaSubproject(name: String) =
Project(
id = s"akka-http-$name-experimental",
base = file(s"akka-http-marshallers-java/akka-http-$name"),
dependencies = Seq(http),
settings = defaultSettings
dependencies = Seq(http)
)
lazy val parsing = Project(
id = "akka-parsing-experimental",
base = file("akka-parsing"),
settings = defaultSettings ++ Seq(
scalacOptions += "-language:_",
// ScalaDoc doesn't like the macros
sources in doc in Compile := List()
)
base = file("akka-parsing")
)
lazy val stream = Project(
id = "akka-stream-experimental",
base = file("akka-stream"),
dependencies = Seq(actor),
settings = defaultSettings ++ experimentalSettings
dependencies = Seq(actor)
)
lazy val streamTests = Project(
id = "akka-stream-tests-experimental",
base = file("akka-stream-tests"),
dependencies = Seq(streamTestkit % "test->test", stream),
settings = defaultSettings ++ experimentalSettings
dependencies = Seq(streamTestkit % "test->test", stream)
)
lazy val streamTestsTck = Project(
id = "akka-stream-tests-tck-experimental",
base = file("akka-stream-tests-tck"),
dependencies = Seq(streamTestkit % "test->test", stream),
settings = defaultSettings ++ experimentalSettings
dependencies = Seq(streamTestkit % "test->test", stream)
)
lazy val kernel = Project(
@ -415,13 +323,6 @@ object AkkaBuild extends Build {
)
)
lazy val docsDev = Project(
id = "akka-docs-dev",
base = file("akka-docs-dev"),
dependencies = Seq(streamTestkit % "test->test", stream, httpCore, http, httpTestkit, httpSprayJson, httpXml),
settings = defaultSettings
)
lazy val contrib = Project(
id = "akka-contrib",
base = file("akka-contrib"),
@ -489,7 +390,8 @@ object AkkaBuild extends Build {
val dontPublishSettings = Seq(
publishSigned := (),
publish := ()
publish := (),
publishArtifact in Compile := false
)
override lazy val settings =

View file

@ -5,7 +5,7 @@ package akka
import sbt._
import sbtunidoc.Plugin.UnidocKeys._
import sbtunidoc.Plugin.{ ScalaUnidoc, JavaUnidoc, scalaJavaUnidocSettings, genjavadocExtraSettings, scalaUnidocSettings }
import sbtunidoc.Plugin.{ ScalaUnidoc, JavaUnidoc, Genjavadoc, scalaJavaUnidocSettings, genjavadocExtraSettings, scalaUnidocSettings }
import sbt.Keys._
import sbt.File
import scala.annotation.tailrec
@ -120,7 +120,7 @@ object UnidocRoot extends AutoPlugin {
override lazy val projectSettings =
CliOptions.genjavadocEnabled.ifTrue(scalaJavaUnidocSettings).getOrElse(scalaUnidocSettings) ++
settings(Seq(AkkaBuild.samples), Seq(AkkaBuild.remoteTests, AkkaBuild.benchJmh))
settings(Seq(AkkaBuild.samples), Seq(AkkaBuild.remoteTests, AkkaBuild.benchJmh, AkkaBuild.parsing, AkkaBuild.protobuf))
}
/**
@ -134,7 +134,9 @@ object Unidoc extends AutoPlugin {
override lazy val projectSettings = UnidocRoot.CliOptions.genjavadocEnabled.ifTrue(
genjavadocExtraSettings ++ Seq(
scalacOptions in Compile += "-P:genjavadoc:fabricateParams=true",
unidocGenjavadocVersion in Global := "0.9"
unidocGenjavadocVersion in Global := "0.9",
// FIXME: see #18056
sources in(Genjavadoc, doc) ~= (_.filterNot(_.getPath.contains("Access$minusControl$minusAllow$minusOrigin")))
)
).getOrElse(Seq.empty)
}

View file

@ -1 +1 @@
sbt.version=0.13.7
sbt.version=0.13.9