Skip to content

Commit

Permalink
! build: only depend on aspectjweaver with provided scope, closes #106
Browse files Browse the repository at this point in the history
  • Loading branch information
ivantopo committed Nov 9, 2014
1 parent 6adfad4 commit 0bb5741
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 16 deletions.
13 changes: 11 additions & 2 deletions project/AspectJ.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import sbt._
import sbt.Keys._
import com.typesafe.sbt.SbtAspectj.{ Aspectj, aspectjSettings }
import com.typesafe.sbt.SbtAspectj.{ Aspectj, defaultAspectjSettings }
import com.typesafe.sbt.SbtAspectj.AspectjKeys.{ aspectjVersion, compileOnly, lintProperties, weaverOptions }


object AspectJ {

lazy val aspectJSettings = aspectjSettings ++ Seq(
lazy val aspectJSettings = inConfig(Aspectj)(defaultAspectjSettings) ++ aspectjDependencySettings ++ Seq(
aspectjVersion in Aspectj := Dependencies.aspectjVersion,
compileOnly in Aspectj := true,
fork in Test := true,
javaOptions in Test <++= weaverOptions in Aspectj,
javaOptions in run <++= weaverOptions in Aspectj,
lintProperties in Aspectj += "invalidAbsoluteTypeName = ignore"
)

def aspectjDependencySettings = Seq(
ivyConfigurations += Aspectj,
libraryDependencies <++= (aspectjVersion in Aspectj) { version => Seq(
"org.aspectj" % "aspectjtools" % version % Aspectj.name,
"org.aspectj" % "aspectjweaver" % version % Aspectj.name,
"org.aspectj" % "aspectjrt" % version % Aspectj.name
)}
)
}
5 changes: 2 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ object Dependencies {

val sprayVersion = "1.3.2"
val akkaVersion = "2.3.6"
val aspectjVersion = "1.8.1"
val aspectjVersion = "1.8.4"
val slf4jVersion = "1.7.6"
val playVersion = "2.3.5"

val sprayJson = "io.spray" %% "spray-json" % "1.3.0"
val sprayJsonLenses = "net.virtual-void" %% "json-lenses" % "0.5.4"
val scalatest = "org.scalatest" %% "scalatest" % "2.2.1"
val logback = "ch.qos.logback" % "logback-classic" % "1.0.13"
val aspectJ = "org.aspectj" % "aspectjrt" % aspectjVersion
val aspectJ = "org.aspectj" % "aspectjweaver" % aspectjVersion
val newrelic = "com.newrelic.agent.java" % "newrelic-api" % "3.11.0"
val snakeYaml = "org.yaml" % "snakeyaml" % "1.13"
val hdrHistogram = "org.hdrhistogram" % "HdrHistogram" % "1.2.1"
val sprayCan = "io.spray" %% "spray-can" % sprayVersion
val sprayRouting = "io.spray" %% "spray-routing" % sprayVersion
Expand Down
48 changes: 37 additions & 11 deletions project/Projects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ object Projects extends Build {
mappings in (Compile, packageBin) ++= mappings.in(kamonMacros, Compile, packageBin).value,
mappings in (Compile, packageSrc) ++= mappings.in(kamonMacros, Compile, packageSrc).value,
libraryDependencies ++=
compile(akkaActor, aspectJ, hdrHistogram) ++
compile(akkaActor, hdrHistogram) ++
provided(aspectJ) ++
optional(logback, scalazConcurrent) ++
test(scalatest, akkaTestKit, sprayTestkit, akkaSlf4j, logback))
test(scalatest, akkaTestKit, akkaSlf4j, logback))


lazy val kamonAkkaRemote = Project("kamon-akka-remote", file("kamon-akka-remote"))
Expand All @@ -36,6 +37,7 @@ object Projects extends Build {
.settings(
libraryDependencies ++=
compile(akkaRemote, akkaCluster) ++
provided(aspectJ) ++
test(scalatest, akkaTestKit))


Expand All @@ -48,7 +50,8 @@ object Projects extends Build {
mappings in (Compile, packageBin) ++= mappings.in(kamonMacros, Compile, packageBin).value,
mappings in (Compile, packageSrc) ++= mappings.in(kamonMacros, Compile, packageSrc).value,
libraryDependencies ++=
compile(akkaActor, aspectJ, sprayCan, sprayClient, sprayRouting) ++
compile(akkaActor, sprayCan, sprayClient, sprayRouting) ++
provided(aspectJ) ++
test(scalatest, akkaTestKit, sprayTestkit, slf4Api, slf4nop))
.dependsOn(kamonCore)
.dependsOn(kamonTestkit % "test")
Expand All @@ -60,7 +63,8 @@ object Projects extends Build {
.settings(aspectJSettings: _*)
.settings(
libraryDependencies ++=
compile(aspectJ, sprayCan, sprayClient, sprayRouting, sprayJson, sprayJsonLenses, newrelic, snakeYaml, akkaSlf4j) ++
compile(sprayCan, sprayClient, sprayRouting, sprayJson, sprayJsonLenses, newrelic, akkaSlf4j) ++
provided(aspectJ) ++
test(scalatest, akkaTestKit, sprayTestkit, slf4Api, akkaSlf4j))
.dependsOn(kamonCore)

Expand All @@ -79,41 +83,60 @@ object Projects extends Build {
lazy val kamonDashboard = Project("kamon-dashboard", file("kamon-dashboard"))
.settings(basicSettings: _*)
.settings(formatSettings: _*)
.settings(libraryDependencies ++= compile(akkaActor, akkaSlf4j, sprayRouting, sprayCan, sprayJson))
.settings(
libraryDependencies ++=
compile(akkaActor, akkaSlf4j, sprayRouting, sprayCan, sprayJson))
.dependsOn(kamonCore)


lazy val kamonTestkit = Project("kamon-testkit", file("kamon-testkit"))
.settings(basicSettings: _*)
.settings(formatSettings: _*)
.settings(libraryDependencies ++= compile(akkaActor, akkaTestKit, aspectJ) ++ test(slf4Api, slf4nop))
.settings(
libraryDependencies ++=
compile(akkaActor, akkaTestKit) ++
provided(aspectJ) ++
test(slf4Api, slf4nop))
.dependsOn(kamonCore)

lazy val kamonPlay = Project("kamon-play", file("kamon-play"))
.settings(basicSettings: _*)
.settings(formatSettings: _*)
.settings(aspectJSettings: _*)
.settings(libraryDependencies ++= compile(play, playWS, aspectJ) ++ test(playTest, akkaTestKit, slf4Api))
.settings(
libraryDependencies ++=
compile(play, playWS) ++
provided(aspectJ) ++
test(playTest, akkaTestKit, slf4Api))
.dependsOn(kamonCore)

lazy val kamonStatsD = Project("kamon-statsd", file("kamon-statsd"))
.settings(basicSettings: _*)
.settings(formatSettings: _*)
.settings(libraryDependencies ++= compile(akkaActor) ++ test(scalatest, akkaTestKit, slf4Api, slf4nop))
.settings(
libraryDependencies ++=
compile(akkaActor) ++
test(scalatest, akkaTestKit, slf4Api, slf4nop))
.dependsOn(kamonCore)
.dependsOn(kamonSystemMetrics % "provided")

lazy val kamonDatadog = Project("kamon-datadog", file("kamon-datadog"))
.settings(basicSettings: _*)
.settings(formatSettings: _*)
.settings(libraryDependencies ++= compile(akkaActor) ++ test(scalatest, akkaTestKit, slf4Api, slf4nop))
.settings(
libraryDependencies ++=
compile(akkaActor) ++
test(scalatest, akkaTestKit, slf4Api, slf4nop))
.dependsOn(kamonCore)
.dependsOn(kamonSystemMetrics % "provided")

lazy val kamonLogReporter = Project("kamon-log-reporter", file("kamon-log-reporter"))
.settings(basicSettings: _*)
.settings(formatSettings: _*)
.settings(libraryDependencies ++= compile(akkaActor) ++ test(scalatest, akkaTestKit, slf4Api, slf4nop))
.settings(
libraryDependencies ++=
compile(akkaActor) ++
test(scalatest, akkaTestKit, slf4Api, slf4nop))
.dependsOn(kamonCore)
.dependsOn(kamonSystemMetrics % "provided")

Expand All @@ -126,8 +149,11 @@ object Projects extends Build {
lazy val kamonSystemMetrics = Project("kamon-system-metrics", file("kamon-system-metrics"))
.settings(basicSettings: _*)
.settings(formatSettings: _*)
.settings(libraryDependencies ++= compile(sigar) ++ test(scalatest, akkaTestKit, slf4Api, slf4nop))
.settings(fork in Test := true)
.settings(
libraryDependencies ++=
compile(sigar) ++
test(scalatest, akkaTestKit, slf4Api, slf4nop))
.dependsOn(kamonCore)

val noPublishing = Seq(publish := (), publishLocal := (), publishArtifact := false)
Expand Down

0 comments on commit 0bb5741

Please sign in to comment.