aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2015-02-12 11:30:06 +0100
committerIvan Topolnjak <ivantopo@gmail.com>2015-02-13 05:15:30 +0100
commitc6bb65535bcc3cc1ff3834a91473ee8dfa6145e8 (patch)
treed7dbe6a1007b168998f167ac74a98744542c6fa8 /project
parent6729c9632245328a007332cdcce7d362584d735a (diff)
downloadKamon-c6bb65535bcc3cc1ff3834a91473ee8dfa6145e8.tar.gz
Kamon-c6bb65535bcc3cc1ff3834a91473ee8dfa6145e8.tar.bz2
Kamon-c6bb65535bcc3cc1ff3834a91473ee8dfa6145e8.zip
! all: Kamon now works as a single instance in a companion object.
Diffstat (limited to 'project')
-rw-r--r--project/Projects.scala6
-rw-r--r--project/Settings.scala24
2 files changed, 21 insertions, 9 deletions
diff --git a/project/Projects.scala b/project/Projects.scala
index 2004ac07..e2aed340 100644
--- a/project/Projects.scala
+++ b/project/Projects.scala
@@ -111,7 +111,7 @@ object Projects extends Build {
compile(sprayCan, sprayClient, sprayRouting, sprayJson, sprayJsonLenses, newrelic, akkaSlf4j) ++
provided(aspectJ) ++
test(scalatest, akkaTestKit, sprayTestkit, slf4Api, akkaSlf4j))
- .dependsOn(kamonCore)
+ .dependsOn(kamonCore % "compile->compile;test->test")
.dependsOn(kamonTestkit % "compile->compile;test->test")
@@ -165,7 +165,7 @@ object Projects extends Build {
libraryDependencies ++=
compile(akkaActor) ++
test(scalatest, akkaTestKit, slf4Api, slf4nop))
- .dependsOn(kamonCore)
+ .dependsOn(kamonCore % "compile->compile;test->test")
.dependsOn(kamonSystemMetrics % "provided")
lazy val kamonDatadog = Project("kamon-datadog", file("kamon-datadog"))
@@ -175,7 +175,7 @@ object Projects extends Build {
libraryDependencies ++=
compile(akkaActor) ++
test(scalatest, akkaTestKit, slf4Api, slf4nop))
- .dependsOn(kamonCore)
+ .dependsOn(kamonCore % "compile->compile;test->test")
.dependsOn(kamonSystemMetrics % "provided")
lazy val kamonLogReporter = Project("kamon-log-reporter", file("kamon-log-reporter"))
diff --git a/project/Settings.scala b/project/Settings.scala
index 22a1f4e7..700312c1 100644
--- a/project/Settings.scala
+++ b/project/Settings.scala
@@ -13,9 +13,11 @@
* =========================================================================================
*/
+import com.typesafe.sbt.SbtAspectj.AspectjKeys._
+import sbt.Tests.{SubProcess, Group}
import sbt._
import Keys._
-import com.typesafe.sbt.SbtScalariform
+import com.typesafe.sbt.{SbtAspectj, SbtScalariform}
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import Publish.{settings => publishSettings}
import Release.{settings => releaseSettings}
@@ -29,17 +31,18 @@ object Settings {
val ScalaVersion = "2.10.4"
lazy val basicSettings = Seq(
- scalaVersion := ScalaVersion,
- resolvers ++= Dependencies.resolutionRepos,
- fork in run := true,
+ scalaVersion := ScalaVersion,
+ resolvers ++= Dependencies.resolutionRepos,
+ fork in run := true,
+ testGrouping in Test := singleTests((definedTests in Test).value, (javaOptions in Test).value),
javacOptions in compile := Seq(
"-Xlint:-options",
"-source", JavaVersion, "-target", JavaVersion
),
- javacOptions in doc := Seq(
+ javacOptions in doc := Seq(
"-source", JavaVersion
),
- scalacOptions := Seq(
+ scalacOptions := Seq(
"-encoding",
"utf8",
"-g:vars",
@@ -54,6 +57,15 @@ object Settings {
"-Xlog-reflective-calls"
)) ++ publishSettings ++ releaseSettings ++ graphSettings
+
+ def singleTests(tests: Seq[TestDefinition], jvmSettings: Seq[String]): Seq[Group] =
+ tests map { test =>
+ new Group(
+ name = test.name,
+ tests = Seq(test),
+ runPolicy = SubProcess(ForkOptions(runJVMOptions = jvmSettings)))
+ }
+
lazy val formatSettings = SbtScalariform.scalariformSettings ++ Seq(
ScalariformKeys.preferences in Compile := formattingPreferences,
ScalariformKeys.preferences in Test := formattingPreferences