Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile to 2.12 #21

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -8,6 +8,6 @@ before_script:
- tar -xvf protobuf-2.6.1.tar.gz
- cd protobuf-2.6.1 && ./configure && make && sudo make install && sudo ldconfig && cd ..
script:
- sbt clean buffered-config-test:test invalid-config-test:test coverage test coverageReport && sbt coverageAggregate
- sbt clean +buffered-config-test:test +invalid-config-test:test coverage +test +coverageReport && sbt coverageAggregate
after_success:
- sbt coveralls
17 changes: 12 additions & 5 deletions build.sbt
Expand Up @@ -4,14 +4,15 @@ import sbtprotobuf.ProtobufPlugin
val akkaVersion = "2.4.16"
val akkaHttpVersion = "10.0.1"
val sprayVersion = "1.3.4"
val kamonVersion = "0.6.3"
val kamonVersion = "0.6.7"

lazy val commonSettings = Seq(
homepage := Some(url("https://monsantoco.github.io/kamon-prometheus")),
organization := "com.monsanto.arch",
organizationHomepage := Some(url("http://engineering.monsanto.org")),
licenses := Seq("BSD New" → url("http://opensource.org/licenses/BSD-3-Clause")),
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.11.8", "2.12.2"),
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
Expand Down Expand Up @@ -71,7 +72,6 @@ lazy val library = (project in file("library"))
description := "Kamon module to export metrics to Prometheus",
libraryDependencies ++= Seq(
"io.kamon" %% "kamon-core" % kamonVersion,
"io.spray" %% "spray-routing" % sprayVersion % "provided",
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion % "provided",
"com.typesafe" % "config" % "1.3.1",
Expand All @@ -82,10 +82,15 @@ lazy val library = (project in file("library"))
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion % testConfigs,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"org.scalatest" %% "scalatest" % "3.0.1" % testConfigs,
"io.kamon" %% "kamon-akka" % kamonVersion % "test",
"io.spray" %% "spray-testkit" % sprayVersion % "test",
"io.kamon" %% "kamon-akka-2.4" % kamonVersion % "test",
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test"
),
libraryDependencies ++= {
if (scalaBinaryVersion.value == "2.11") Seq(
"io.spray" %% "spray-routing" % sprayVersion % "provided",
"io.spray" %% "spray-testkit" % sprayVersion % "test"
) else Seq.empty
},
dependencyOverrides ++= Set(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"org.scala-lang" % "scala-library" % scalaVersion.value,
Expand All @@ -105,13 +110,14 @@ lazy val demo = (project in file("demo"))
.enablePlugins(DockerPlugin)
.settings(
commonSettings,
crossScalaVersions := Seq("2.11.8"),
aspectjSettings,
noPublishing,
name := "kamon-prometheus-demo",
description := "Docker image containing a demonstration of kamon-prometheus in action.",
libraryDependencies ++= Seq(
"io.kamon" %% "kamon-spray" % kamonVersion,
"io.kamon" %% "kamon-system-metrics" % kamonVersion,
"io.kamon" %% "kamon-spray" % kamonVersion,
"io.spray" %% "spray-can" % sprayVersion,
"com.monsanto.arch" %% "spray-kamon-metrics" % "0.1.3"
),
Expand Down Expand Up @@ -191,6 +197,7 @@ lazy val ghPagesSettings =
)

lazy val `kamon-prometheus` = (project in file("."))
.enablePlugins(CrossPerProjectPlugin)
.disablePlugins(sbtassembly.AssemblyPlugin)
.aggregate(library, demo)
.settings(
Expand Down
Expand Up @@ -3,7 +3,7 @@ package com.monsanto.arch.kamon.prometheus
import com.typesafe.config.{Config, ConfigFactory}
import kamon.util.ConfigTools.Syntax

import scala.collection.JavaConversions
import scala.collection.JavaConverters._
import scala.concurrent.duration.FiniteDuration

/** A settings object used for configuring how the extension should behave.
Expand All @@ -22,11 +22,10 @@ class PrometheusSettings(config: Config) {

/** The subscriptions that determine which metrics the extension will publish to Prometheus. */
val subscriptions: Map[String, List[String]] = {
import JavaConversions.asScalaBuffer

val subs: Config = prometheusConfig.getConfig("subscriptions")
subs.firstLevelKeys.map { category ⇒
category → subs.getStringList(category).toList
category → subs.getStringList(category).asScala.toList
}.toMap
}

Expand Down
6 changes: 4 additions & 2 deletions project/plugins.sbt
Expand Up @@ -4,11 +4,11 @@ addSbtPlugin("io.spray" % "sbt-revolver" % "0.8.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-aspectj" % "0.10.6")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3" exclude("org.apache.maven", "maven-plugin-api"))

addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.4.0")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")

Expand All @@ -22,6 +22,8 @@ addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.1.0")

addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.3")

addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.5")

dependencyOverrides ++= Set(
"com.typesafe.sbt" % "sbt-site" % "0.8.2"
)