Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b39b47
commit ffde442
Showing
4 changed files
with
147 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact | ||
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings | ||
import org.scoverage.coveralls.CoverallsPlugin | ||
import sbtdoge.CrossPerProjectPlugin | ||
|
||
lazy val projectInfo = Seq ( | ||
organization := "com.github.levkhomich", | ||
version := "0.6.1-SNAPSHOT", | ||
homepage := Some(url("https://github.com/levkhomich/akka-tracing")), | ||
scmInfo := Some(ScmInfo( | ||
url("https://github.com/levkhomich/akka-tracing.git"), | ||
"scm:git:git@github.com:levkhomich/akka-tracing.git" | ||
)), | ||
startYear := Some(2014), | ||
licenses := Seq("Apache Public License 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), | ||
developers := List( | ||
Developer("levkhomich", "Lev Khomich", "levkhomich@gmail.com", url("http://github.com/levkhomich")) | ||
) | ||
) | ||
|
||
lazy val root = (project in file(".")).settings(commonSettings).settings( | ||
publish := (), | ||
publishLocal := (), | ||
// workaround for sbt-pgp | ||
packagedArtifacts := Map.empty, | ||
previousArtifact := None | ||
).aggregate(`akka-tracing-core`, `akka-tracing-play`, `akka-tracing-http`).enablePlugins(CrossPerProjectPlugin) | ||
|
||
lazy val `akka-tracing-core` = (project in file("core")).settings(commonSettings).settings( | ||
libraryDependencies ++= Dependencies.thrift ++ Dependencies.akka ++ Dependencies.test(scalaVersion.value), | ||
sourceGenerators in Compile += Def.task { | ||
val srcManaged = (sourceManaged in Compile).value | ||
val thriftSrc = (sourceDirectory in Compile).value / "thrift" / "zipkin.thrift" | ||
s"${baseDirectory.value}/project/gen_thrift.sh $thriftSrc $srcManaged".! | ||
(srcManaged / "com" / "github" / "levkhomich" / "akka" / "tracing" / "thrift").listFiles().toSeq | ||
}.taskValue | ||
) | ||
|
||
lazy val `akka-tracing-play` = (project in file("play")).settings(commonSettings).settings( | ||
crossScalaVersions := Seq("2.11.11"), | ||
libraryDependencies ++= Dependencies.play ++ Dependencies.testPlay(scalaVersion.value), | ||
previousArtifact := None | ||
).dependsOn(`akka-tracing-core` % passTestDeps) | ||
|
||
lazy val `akka-tracing-http` = (project in file("akka-http")).settings(commonSettings).settings( | ||
libraryDependencies ++= Dependencies.http ++ Dependencies.test(scalaVersion.value) | ||
).dependsOn(`akka-tracing-core` % passTestDeps) | ||
|
||
lazy val commonSettings = projectInfo ++ compilationSettings ++ testSettings ++ publicationSettings ++ scalariformSettings | ||
|
||
lazy val compilationSettings = | ||
Seq( | ||
scalaVersion := "2.11.11", | ||
crossScalaVersions := Seq("2.11.11", "2.12.3"), | ||
scalacOptions ++= Seq( | ||
"-target:jvm-1.8", | ||
"-encoding", "utf8", | ||
"-deprecation", | ||
"-unchecked", | ||
"-feature", | ||
"-language:_", | ||
"-Xcheckinit", | ||
"-Xlint", | ||
"-Xlog-reflective-calls" | ||
), | ||
javacOptions ++= Seq( | ||
"-Xlint:all", | ||
"-source", "1.8", | ||
"-target", "1.8" | ||
), | ||
updateOptions := updateOptions.value.withCachedResolution(true) | ||
) | ||
|
||
lazy val testSettings = | ||
CoverallsPlugin.projectSettings ++ | ||
mimaDefaultSettings ++ | ||
Seq( | ||
previousArtifact := Some(organization.value % (moduleName.value + '_' + scalaBinaryVersion.value) % "0.4"), | ||
scalacOptions in Test ++= Seq("-Yrangepos") | ||
) | ||
|
||
lazy val publicationSettings = Seq( | ||
publishMavenStyle := true, | ||
publishTo <<= version { v => | ||
if (v.endsWith("SNAPSHOT")) | ||
Some(Resolver.sonatypeRepo("snapshots")) | ||
else | ||
Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2") | ||
}, | ||
publishArtifact in Test := false, | ||
pomIncludeRepository := { _ => false }, | ||
com.typesafe.sbt.SbtScalariform.ScalariformKeys.preferences := { | ||
import scalariform.formatter.preferences._ | ||
FormattingPreferences() | ||
.setPreference(AlignParameters, true) | ||
.setPreference(DoubleIndentClassDeclaration, true) | ||
.setPreference(PreserveDanglingCloseParenthesis, true) | ||
.setPreference(PreserveSpaceBeforeArguments, true) | ||
} | ||
) | ||
|
||
lazy val passTestDeps = "test->test;compile->compile" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import sbt._ | ||
|
||
object Dependencies { | ||
|
||
val PlayVersion = "2.5.13" | ||
val AkkaVersion = "2.4.17" | ||
val AkkaHttpVersion = "10.0.5" | ||
|
||
object Compile { | ||
val akkaActor = "com.typesafe.akka" %% "akka-actor" % AkkaVersion | ||
val akkaAgent = "com.typesafe.akka" %% "akka-agent" % AkkaVersion | ||
val akkaStream = "com.typesafe.akka" %% "akka-stream" % AkkaVersion | ||
val akkaHttp = "com.typesafe.akka" %% "akka-http" % AkkaHttpVersion | ||
val play = "com.typesafe.play" %% "play" % PlayVersion | ||
val config = "com.typesafe" % "config" % "1.3.1" | ||
val libThrift = "org.apache.thrift" % "libthrift" % "0.10.0" | ||
} | ||
|
||
object Test { | ||
val specs = "org.specs2" %% "specs2-core" % "3.8.9" % "test" | ||
val finagle = "com.twitter" %% "finagle-core" % "6.43.0" % "test" | ||
val braveCore = "io.zipkin.brave" % "brave-core" % "4.0.6" % "test" | ||
val playSpecs2 = "com.typesafe.play" %% "play-specs2" % PlayVersion % "test" | ||
val akkaTest = "com.typesafe.akka" %% "akka-testkit" % AkkaVersion % "test" | ||
val akkaRemote = "com.typesafe.akka" %% "akka-remote" % AkkaVersion % "test" | ||
val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % AkkaVersion % "test" | ||
val akkaHttpTest = "com.typesafe.akka" %% "akka-http-testkit" % AkkaHttpVersion % "test" | ||
val logback = "ch.qos.logback" % "logback-classic" % "1.2.2" % "test" | ||
} | ||
|
||
val akka = Seq(Compile.akkaActor, Compile.akkaAgent, Compile.akkaStream, Compile.config) | ||
val play = Seq(Compile.play) | ||
val http = Seq(Compile.akkaHttp) | ||
val thrift = Seq(Compile.libThrift) | ||
|
||
def test(scalaVersion: String): Seq[ModuleID] = | ||
Seq(Test.specs, Test.finagle, Test.braveCore, Test.akkaTest, | ||
Test.akkaHttpTest, Test.akkaRemote, Test.akkaSlf4j, Test.logback) | ||
|
||
def testPlay(scalaVersion: String): Seq[ModuleID] = | ||
test(scalaVersion) :+ Test.playSpecs2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters