2016-02-23 12:58:39 +01:00
/* *
2017-01-04 17:37:10 +01:00
* Copyright ( C ) 2016 - 2017 Lightbend Inc . < http : //www.lightbend.com>
2016-02-23 12:58:39 +01:00
*/
2014-05-07 14:49:35 +02:00
package akka
import sbt._
2015-05-21 21:07:37 +02:00
import Keys._
2014-05-07 14:49:35 +02:00
object Dependencies {
2016-01-12 13:45:18 +01:00
import DependencyHelpers._
2014-05-07 14:49:35 +02:00
2015-05-21 21:07:37 +02:00
lazy val scalaTestVersion = settingKey [ String ] ( "The version of ScalaTest to use." )
lazy val scalaStmVersion = settingKey [ String ] ( "The version of ScalaSTM to use." )
lazy val scalaCheckVersion = settingKey [ String ] ( "The version of ScalaCheck to use." )
2016-04-13 17:33:32 +02:00
lazy val java8CompatVersion = settingKey [ String ] ( "The version of scala-java8-compat to use." )
2016-01-20 12:20:21 +01:00
val junitVersion = "4.12"
2016-10-28 16:41:26 +02:00
val sslConfigVersion = "0.2.1"
2017-02-23 14:17:13 +00:00
val slf4jVersion = "1.7.23"
val scalaXmlVersion = "1.0.6"
2017-04-11 18:30:18 +02:00
val aeronVersion = "1.2.5"
2014-09-16 10:53:04 +02:00
2015-05-21 21:07:37 +02:00
val Versions = Seq (
2017-04-19 12:57:27 +02:00
crossScalaVersions : = Seq ( "2.11.11" , "2.12.2" ) ,
2016-12-20 15:27:32 +01:00
scalaVersion : = System . getProperty ( "akka.build.scalaVersion" , crossScalaVersions . value . head ) ,
2016-11-21 13:03:09 +01:00
scalaStmVersion : = sys . props . get ( "akka.build.scalaStmVersion" ) . getOrElse ( "0.8" ) ,
2016-11-03 16:17:36 +01:00
scalaCheckVersion : = sys . props . get ( "akka.build.scalaCheckVersion" ) . getOrElse (
2017-03-13 12:39:57 +01:00
CrossVersion . partialVersion ( scalaVersion . value ) match {
case Some ( ( 2 , n ) ) if n >= 12 => "1.13.4" // does not work for 2.11
case _ => "1.13.2"
}
2016-11-03 16:17:36 +01:00
) ,
scalaTestVersion : = "3.0.0" ,
2016-04-13 17:33:32 +02:00
java8CompatVersion : = {
2017-03-13 12:39:57 +01:00
CrossVersion . partialVersion ( scalaVersion . value ) match {
case Some ( ( 2 , n ) ) if n >= 12 => "0.8.0"
case _ => "0.7.0"
2016-04-13 17:33:32 +02:00
}
}
2015-05-21 21:07:37 +02:00
)
2014-05-07 14:49:35 +02:00
object Compile {
// Compile
2015-06-08 12:26:19 +02:00
2017-06-09 03:53:28 -07:00
val camelCore = "org.apache.camel" % "camel-core" % "2.15.6" exclude ( "org.slf4j" , "slf4j-api" ) // ApacheV2
2014-05-07 14:49:35 +02:00
2014-06-12 17:26:26 +09:00
// when updating config version, update links ActorSystem ScalaDoc to link to the updated version
2017-02-12 16:40:12 -05:00
val config = "com.typesafe" % "config" % "1.3.1" // ApacheV2
2016-06-29 20:37:45 +02:00
val netty = "io.netty" % "netty" % "3.10.6.Final" // ApacheV2
2015-05-21 21:07:37 +02:00
val scalaStm = Def . setting { "org.scala-stm" %% "scala-stm" % scalaStmVersion . value } // Modified BSD (Scala)
2014-05-07 14:49:35 +02:00
2017-02-23 14:17:13 +00:00
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % scalaXmlVersion // Scala License
2016-01-12 13:45:18 +01:00
val scalaReflect = ScalaVersionDependentModuleID . versioned ( "org.scala-lang" % "scala-reflect" % _ ) // Scala License
2017-02-12 16:40:12 -05:00
val slf4jApi = "org.slf4j" % "slf4j-api" % slf4jVersion // MIT
2016-01-12 13:45:18 +01:00
2017-02-14 13:10:23 +02:00
// mirrored in OSGi sample https://github.com/akka/akka-samples/tree/master/akka-sample-osgi-dining-hakkers
2014-05-07 14:49:35 +02:00
val osgiCore = "org.osgi" % "org.osgi.core" % "4.3.1" // ApacheV2
val osgiCompendium = "org.osgi" % "org.osgi.compendium" % "4.3.1" // ApacheV2
2015-03-06 11:58:51 -06:00
2014-11-13 18:56:02 +02:00
val sigar = "org.fusesource" % "sigar" % "1.6.4" // ApacheV2
2014-05-07 14:49:35 +02:00
2016-01-12 13:45:18 +01:00
// reactive streams
2017-07-10 21:40:12 +09:00
val reactiveStreams = "org.reactivestreams" % "reactive-streams" % "1.0.0" // CC0 // TODO update to 1.0.1 once it's released, we don't want to ship artifacts depending on RCs
2016-01-12 13:45:18 +01:00
// ssl-config
2016-10-28 16:41:26 +02:00
val sslConfigCore = "com.typesafe" %% "ssl-config-core" % sslConfigVersion // ApacheV2
2017-02-23 14:17:13 +00:00
val lmdb = "org.lmdbjava" % "lmdbjava" % "0.0.5" // ApacheV2, OpenLDAP Public License
2016-01-12 13:45:18 +01:00
// For akka-http-testkit-java
2016-01-20 12:20:21 +01:00
val junit = "junit" % "junit" % junitVersion // Common Public License 1.0
2016-01-14 11:25:56 +01:00
// For Java 8 Conversions
2016-04-13 17:33:32 +02:00
val java8Compat = Def . setting { "org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion . value } // Scala License
2017-02-23 14:17:13 +00:00
val aeronDriver = "io.aeron" % "aeron-driver" % aeronVersion // ApacheV2
val aeronClient = "io.aeron" % "aeron-client" % aeronVersion // ApacheV2
2015-05-29 18:20:51 +02:00
object Docs {
2017-02-23 14:17:13 +00:00
val sprayJson = "io.spray" %% "spray-json" % "1.3.3" % "test"
val gson = "com.google.code.gson" % "gson" % "2.8.0" % "test"
2015-05-29 18:20:51 +02:00
}
2014-05-07 14:49:35 +02:00
object Test {
2015-05-08 16:35:29 +02:00
val commonsMath = "org.apache.commons" % "commons-math" % "2.2" % "test" // ApacheV2
2017-02-23 14:17:13 +00:00
val commonsIo = "commons-io" % "commons-io" % "2.5" % "test" // ApacheV2
2015-05-08 16:35:29 +02:00
val commonsCodec = "commons-codec" % "commons-codec" % "1.10" % "test" // ApacheV2
2016-01-20 12:20:21 +01:00
val junit = "junit" % "junit" % junitVersion % "test" // Common Public License 1.0
2017-05-19 13:30:57 +02:00
val logback = "ch.qos.logback" % "logback-classic" % "1.2.3" % "test" // EPL 1.0 / LGPL 2.1
2015-05-08 16:35:29 +02:00
val mockito = "org.mockito" % "mockito-all" % "1.10.19" % "test" // MIT
2014-05-07 14:49:35 +02:00
// changing the scalatest dependency must be reflected in akka-docs/rst/dev/multi-jvm-testing.rst
2015-05-21 21:07:37 +02:00
val scalatest = Def . setting { "org.scalatest" %% "scalatest" % scalaTestVersion . value % "test" } // ApacheV2
val scalacheck = Def . setting { "org.scalacheck" %% "scalacheck" % scalaCheckVersion . value % "test" } // New BSD
2014-05-07 14:49:35 +02:00
val pojosr = "com.googlecode.pojosr" % "de.kalpatec.pojosr.framework" % "0.2.1" % "test" // ApacheV2
val tinybundles = "org.ops4j.pax.tinybundles" % "tinybundles" % "1.0.0" % "test" // ApacheV2
2017-02-23 14:17:13 +00:00
val log4j = "log4j" % "log4j" % "1.2.17" % "test" // ApacheV2
2015-05-08 16:35:29 +02:00
val junitIntf = "com.novocode" % "junit-interface" % "0.11" % "test" // MIT
2017-02-23 14:17:13 +00:00
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % scalaXmlVersion % "test"
=act,tes Initial draft of internal MetricsKit
Note: This is NOT aimed to provide an micro-benchmarking solution.
The goal is to provide data for broad trend analysis. For techniques
that fight the inliner and other specialised techniques, refer to JMH.
+ custom console and graphite reporters
- had to be custom because it's not possible to add custom metric
types to the existing reporters
+ initial hdr.Histogram histogram() provider, see
http://latencyutils.github.io/LatencyUtils/
+ Not using timers provided by Metrics, instead use the above histogram
+ Added average Actor size measurement
+ Measuring the "blocking time" when an actor is created, before we fire
of the async part of this process; Measures in loop and will fluctuate
a lot. Times are in `us` -- System.nanoTime should provide good enough
resolution.
+ Measuring total actor creation time by using
`KnownOpsInTimespanTimer`, which given a known number of ops, in a
large amount of time, roughtly estimates time per one operation.
// Yes, we are aware of the possibility of GC pauses and other horrors
+ All classes are `private[akka]`, we should not encourage people to use
this yet
+ Counters use Java 8's `LongAdder`, which is metric's private;
The new trend in Java land will be copy paste-ing this class ;)
+ Metrics are logged to Graphite, so we can long-term analyse these
+ Reporters are configurable using typesafe-config
! I'm not very happy about how I work around Metrics not being too open
for adding additional custom metrics. Seems like a hack at places.
I will consider removing the Metrics dependency all together.
numbers
Example output:
```
-- KnownOpsInTimespanTimer-------------------------------------------
actor-creation.total.creating-100000-actors.Props|new-EmptyArgsActor|…||-same
ops = 100000
time = 1.969 s
ops/s = 50782.22
avg = 19.69 μs
-- AveragingGauge---------------------------------------------------
actor-creation.Props|new-EmptyArgsActor|…||-same.avg-mem-per-actor
avg = 439.67
```
2014-04-29 10:50:36 +02:00
2016-08-29 16:33:33 +02:00
// in-memory filesystem for file related tests
val jimfs = "com.google.jimfs" % "jimfs" % "1.1" % "test" // ApacheV2
=act,tes Initial draft of internal MetricsKit
Note: This is NOT aimed to provide an micro-benchmarking solution.
The goal is to provide data for broad trend analysis. For techniques
that fight the inliner and other specialised techniques, refer to JMH.
+ custom console and graphite reporters
- had to be custom because it's not possible to add custom metric
types to the existing reporters
+ initial hdr.Histogram histogram() provider, see
http://latencyutils.github.io/LatencyUtils/
+ Not using timers provided by Metrics, instead use the above histogram
+ Added average Actor size measurement
+ Measuring the "blocking time" when an actor is created, before we fire
of the async part of this process; Measures in loop and will fluctuate
a lot. Times are in `us` -- System.nanoTime should provide good enough
resolution.
+ Measuring total actor creation time by using
`KnownOpsInTimespanTimer`, which given a known number of ops, in a
large amount of time, roughtly estimates time per one operation.
// Yes, we are aware of the possibility of GC pauses and other horrors
+ All classes are `private[akka]`, we should not encourage people to use
this yet
+ Counters use Java 8's `LongAdder`, which is metric's private;
The new trend in Java land will be copy paste-ing this class ;)
+ Metrics are logged to Graphite, so we can long-term analyse these
+ Reporters are configurable using typesafe-config
! I'm not very happy about how I work around Metrics not being too open
for adding additional custom metrics. Seems like a hack at places.
I will consider removing the Metrics dependency all together.
numbers
Example output:
```
-- KnownOpsInTimespanTimer-------------------------------------------
actor-creation.total.creating-100000-actors.Props|new-EmptyArgsActor|…||-same
ops = 100000
time = 1.969 s
ops/s = 50782.22
avg = 19.69 μs
-- AveragingGauge---------------------------------------------------
actor-creation.Props|new-EmptyArgsActor|…||-same.avg-mem-per-actor
avg = 439.67
```
2014-04-29 10:50:36 +02:00
// metrics, measurements, perf testing
2015-05-08 16:35:29 +02:00
val metrics = "com.codahale.metrics" % "metrics-core" % "3.0.2" % "test" // ApacheV2
val metricsJvm = "com.codahale.metrics" % "metrics-jvm" % "3.0.2" % "test" // ApacheV2
=act,tes Initial draft of internal MetricsKit
Note: This is NOT aimed to provide an micro-benchmarking solution.
The goal is to provide data for broad trend analysis. For techniques
that fight the inliner and other specialised techniques, refer to JMH.
+ custom console and graphite reporters
- had to be custom because it's not possible to add custom metric
types to the existing reporters
+ initial hdr.Histogram histogram() provider, see
http://latencyutils.github.io/LatencyUtils/
+ Not using timers provided by Metrics, instead use the above histogram
+ Added average Actor size measurement
+ Measuring the "blocking time" when an actor is created, before we fire
of the async part of this process; Measures in loop and will fluctuate
a lot. Times are in `us` -- System.nanoTime should provide good enough
resolution.
+ Measuring total actor creation time by using
`KnownOpsInTimespanTimer`, which given a known number of ops, in a
large amount of time, roughtly estimates time per one operation.
// Yes, we are aware of the possibility of GC pauses and other horrors
+ All classes are `private[akka]`, we should not encourage people to use
this yet
+ Counters use Java 8's `LongAdder`, which is metric's private;
The new trend in Java land will be copy paste-ing this class ;)
+ Metrics are logged to Graphite, so we can long-term analyse these
+ Reporters are configurable using typesafe-config
! I'm not very happy about how I work around Metrics not being too open
for adding additional custom metrics. Seems like a hack at places.
I will consider removing the Metrics dependency all together.
numbers
Example output:
```
-- KnownOpsInTimespanTimer-------------------------------------------
actor-creation.total.creating-100000-actors.Props|new-EmptyArgsActor|…||-same
ops = 100000
time = 1.969 s
ops/s = 50782.22
avg = 19.69 μs
-- AveragingGauge---------------------------------------------------
actor-creation.Props|new-EmptyArgsActor|…||-same.avg-mem-per-actor
avg = 439.67
```
2014-04-29 10:50:36 +02:00
val latencyUtils = "org.latencyutils" % "LatencyUtils" % "1.0.3" % "test" // Free BSD
2016-07-01 15:38:39 +02:00
val hdrHistogram = "org.hdrhistogram" % "HdrHistogram" % "2.1.9" % "test" // CC0
2014-05-19 17:29:35 +02:00
val metricsAll = Seq ( metrics , metricsJvm , latencyUtils , hdrHistogram )
2014-12-12 11:49:32 -06:00
// sigar logging
2017-02-12 16:40:12 -05:00
val slf4jJul = "org.slf4j" % "jul-to-slf4j" % slf4jVersion % "test" // MIT
val slf4jLog4j = "org.slf4j" % "log4j-over-slf4j" % slf4jVersion % "test" // MIT
2016-01-12 13:45:18 +01:00
// reactive streams tck
2017-07-12 17:08:08 +02:00
val reactiveStreamsTck = "org.reactivestreams" % "reactive-streams-tck" % "1.0.1-RC2" % "test" // CC0
2014-12-12 11:49:32 -06:00
}
object Provided {
// TODO remove from "test" config
2017-05-12 16:07:51 +03:00
// If changed, update akka-docs/build.sbt as well
2015-08-18 14:51:36 +02:00
val sigarLoader = "io.kamon" % "sigar-loader" % "1.6.6-rev002" % "optional;provided;test" // ApacheV2
2016-01-12 13:45:18 +01:00
2015-03-06 11:58:51 -06:00
val levelDB = "org.iq80.leveldb" % "leveldb" % "0.7" % "optional;provided" // ApacheV2
2015-05-08 16:35:29 +02:00
val levelDBNative = "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8" % "optional;provided" // New BSD
2014-05-07 14:49:35 +02:00
}
2016-01-12 13:45:18 +01:00
2014-05-07 14:49:35 +02:00
}
import Compile._
2016-01-12 13:45:18 +01:00
// TODO check if `l ++=` everywhere expensive?
2015-05-21 21:07:37 +02:00
val l = libraryDependencies
2014-05-07 14:49:35 +02:00
2016-04-13 17:33:32 +02:00
val actor = l ++= Seq ( config , java8Compat . value )
2014-05-07 14:49:35 +02:00
2015-05-21 21:07:37 +02:00
val testkit = l ++= Seq ( Test . junit , Test . scalatest . value ) ++ Test . metricsAll
2014-05-07 14:49:35 +02:00
2015-02-18 00:15:50 +01:00
val actorTests = l ++= Seq ( Test . junit , Test . scalatest . value , Test . commonsCodec , Test . commonsMath , Test . mockito , Test . scalacheck . value , Test . junitIntf )
2014-05-07 14:49:35 +02:00
2017-01-12 06:43:12 +01:00
val remote = l ++= Seq ( netty , aeronDriver , aeronClient , Test . junit , Test . scalatest . value , Test . jimfs )
2014-05-07 14:49:35 +02:00
2015-05-21 21:07:37 +02:00
val remoteTests = l ++= Seq ( Test . junit , Test . scalatest . value , Test . scalaXml )
2014-05-07 14:49:35 +02:00
2015-05-21 21:07:37 +02:00
val cluster = l ++= Seq ( Test . junit , Test . scalatest . value )
2016-01-12 13:45:18 +01:00
2015-05-21 21:07:37 +02:00
val clusterTools = l ++= Seq ( Test . junit , Test . scalatest . value )
2016-01-12 13:45:18 +01:00
2015-09-17 08:36:22 +02:00
val clusterSharding = l ++= Seq ( Provided . levelDB , Provided . levelDBNative , Test . junit , Test . scalatest . value , Test . commonsIo )
2014-05-07 14:49:35 +02:00
2015-05-21 21:07:37 +02:00
val clusterMetrics = l ++= Seq ( Provided . sigarLoader , Test . slf4jJul , Test . slf4jLog4j , Test . logback , Test . mockito )
2016-01-12 13:45:18 +01:00
2016-10-10 20:00:24 +02:00
val distributedData = l ++= Seq ( lmdb , Test . junit , Test . scalatest . value )
2014-07-08 18:30:15 +02:00
2015-05-21 21:07:37 +02:00
val slf4j = l ++= Seq ( slf4jApi , Test . logback )
2014-05-07 14:49:35 +02:00
2015-05-21 21:07:37 +02:00
val agent = l ++= Seq ( scalaStm . value , Test . scalatest . value , Test . junit )
2014-05-07 14:49:35 +02:00
2016-02-15 16:53:57 +01:00
val persistence = l ++= Seq ( Provided . levelDB , Provided . levelDBNative , Test . scalatest . value , Test . junit , Test . commonsIo , Test . commonsCodec , Test . scalaXml )
2014-05-07 14:49:35 +02:00
2016-01-12 13:45:18 +01:00
val persistenceQuery = l ++= Seq ( Test . scalatest . value , Test . junit , Test . commonsIo )
2015-06-08 12:26:19 +02:00
2015-05-21 21:07:37 +02:00
val persistenceTck = l ++= Seq ( Test . scalatest . value . copy ( configurations = Some ( "compile" ) ) , Test . junit . copy ( configurations = Some ( "compile" ) ) )
2014-05-07 14:49:35 +02:00
2016-02-15 16:53:57 +01:00
val persistenceShared = l ++= Seq ( Provided . levelDB , Provided . levelDBNative )
2015-05-21 21:07:37 +02:00
val camel = l ++= Seq ( camelCore , Test . scalatest . value , Test . junit , Test . mockito , Test . logback , Test . commonsIo , Test . junitIntf )
2014-09-16 10:53:04 +02:00
2015-05-21 21:07:37 +02:00
val osgi = l ++= Seq ( osgiCore , osgiCompendium , Test . logback , Test . commonsIo , Test . pojosr , Test . tinybundles , Test . scalatest . value , Test . junit )
2014-09-16 10:53:04 +02:00
2015-05-29 18:20:51 +02:00
val docs = l ++= Seq ( Test . scalatest . value , Test . junit , Test . junitIntf , Docs . sprayJson , Docs . gson )
2014-09-16 10:53:04 +02:00
2015-05-21 21:07:37 +02:00
val contrib = l ++= Seq ( Test . junitIntf , Test . commonsIo )
2016-01-12 13:45:18 +01:00
2016-04-19 17:38:26 +02:00
val benchJmh = l ++= Seq ( Provided . levelDB , Provided . levelDBNative )
2016-01-12 13:45:18 +01:00
2016-10-18 15:17:17 +02:00
// akka stream
2016-01-12 13:45:18 +01:00
lazy val stream = l ++= Seq [ sbt . ModuleID ] (
reactiveStreams ,
2016-10-28 16:41:26 +02:00
sslConfigCore ,
2016-01-12 13:45:18 +01:00
Test . junitIntf ,
Test . scalatest . value )
lazy val streamTestkit = l ++= Seq ( Test . scalatest . value , Test . scalacheck . value , Test . junit )
2016-08-29 16:33:33 +02:00
lazy val streamTests = l ++= Seq ( Test . scalatest . value , Test . scalacheck . value , Test . junit , Test . commonsIo , Test . jimfs )
2016-01-12 13:45:18 +01:00
lazy val streamTestsTck = l ++= Seq ( Test . scalatest . value , Test . scalacheck . value , Test . junit , Test . reactiveStreamsTck )
2014-09-16 10:53:04 +02:00
}
2016-01-12 13:45:18 +01:00
object DependencyHelpers {
case class ScalaVersionDependentModuleID ( modules : String => Seq [ ModuleID ] ) {
def % ( config : String ) : ScalaVersionDependentModuleID =
ScalaVersionDependentModuleID ( version => modules ( version ) . map ( _ % config ) )
}
object ScalaVersionDependentModuleID {
implicit def liftConstantModule ( mod : ModuleID ) : ScalaVersionDependentModuleID = versioned ( _ => mod )
def versioned ( f : String => ModuleID ) : ScalaVersionDependentModuleID = ScalaVersionDependentModuleID ( v => Seq ( f ( v ) ) )
def fromPF ( f : PartialFunction [ String , ModuleID ] ) : ScalaVersionDependentModuleID =
ScalaVersionDependentModuleID ( version => if ( f . isDefinedAt ( version ) ) Seq ( f ( version ) ) else Nil )
}
/* *
* Use this as a dependency setting if the dependencies contain both static and Scala - version
* dependent entries .
*/
def versionDependentDeps ( modules : ScalaVersionDependentModuleID * ) : Def.Setting [ Seq [ ModuleID ] ] =
2017-03-15 13:42:10 +01:00
libraryDependencies ++= modules . flatMap ( m => m . modules ( scalaVersion . value ) )
2016-02-18 11:15:24 +02:00
val ScalaVersion = """\d\.\d+\.\d+(?:-(?:M|RC)\d+)?""" . r
val nominalScalaVersion : String => String = {
// matches:
// 2.12.0-M1
// 2.12.0-RC1
// 2.12.0
case version @ ScalaVersion ( ) => version
// transforms 2.12.0-custom-version to 2.12.0
case version => version . takeWhile ( _ != '-' )
}
2016-01-21 18:06:42 +02:00
}