Skip to content

Commit f2eaafb

Browse files
author
Stephen Carman
committed
This should resolve typesafe config correctly on what java version is available, added a plugin for looking at dependencies and seeing what needs to be upgraded.
1 parent c4758e0 commit f2eaafb

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

project/Build.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import scalariform.formatter.preferences._
22

3-
import bintray.Plugin.bintrayPublishSettings
43
import com.typesafe.sbt.SbtScalariform._
54
import sbt.Keys._
65
import sbt._
76
import sbtassembly.AssemblyPlugin.autoImport._
87
import spray.revolver.RevolverPlugin._
8+
import bintray.Plugin.bintrayPublishSettings
9+
import scoverage.ScoverageKeys._
910

1011
// There are advantages to using real Scala build files with SBT:
1112
// - Multi-JVM testing won't work without it, for now
@@ -198,6 +199,7 @@ object JobServerBuild extends Build {
198199
resolvers ++= Dependencies.repos,
199200
libraryDependencies ++= apiDeps,
200201
parallelExecution in Test := false,
202+
201203
// We need to exclude jms/jmxtools/etc because it causes undecipherable SBT errors :(
202204
ivyXML :=
203205
<dependencies>
@@ -208,9 +210,8 @@ object JobServerBuild extends Build {
208210
) ++ scalariformPrefs ++ scoverageSettings
209211

210212
lazy val scoverageSettings = {
211-
import scoverage.ScoverageSbtPlugin
212213
// Semicolon-separated list of regexs matching classes to exclude
213-
ScoverageSbtPlugin.ScoverageKeys.coverageExcludedPackages := ".+Benchmark.*"
214+
coverageExcludedPackages := ".+Benchmark.*"
214215
}
215216

216217
lazy val publishSettings = bintrayPublishSettings ++ Seq(
@@ -225,7 +226,8 @@ object JobServerBuild extends Build {
225226
.setPreference(AlignParameters, true)
226227
.setPreference(AlignSingleLineCaseStatements, true)
227228
.setPreference(DoubleIndentClassDeclaration, true)
228-
.setPreference(PreserveDanglingCloseParenthesis, false)
229+
// This was deprecated.
230+
//.setPreference(PreserveDanglingCloseParenthesis, false)
229231
)
230232

231233
// This is here so we can easily switch back to Logback when Spark fixes its log4j dependency.

project/Dependencies.scala

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@ object Dependencies {
88
val excludeNettyIo = ExclusionRule(organization = "io.netty", artifact= "netty-all")
99
val excludeAsm = ExclusionRule(organization = "asm")
1010
val excludeQQ = ExclusionRule(organization = "org.scalamacros")
11+
val javaVersion = scala.util.Properties.isJavaAtLeast("1.8")
1112

12-
lazy val typeSafeConfigDeps = "com.typesafe" % "config" % "1.3.0"
13+
lazy val typeSafeConfigDeps = if(javaVersion){
14+
"com.typesafe" % "config" % "1.3.0"
15+
} else {
16+
"com.typesafe" % "config" % "1.2.1"
17+
}
1318
lazy val yammerDeps = "com.yammer.metrics" % "metrics-core" % "2.2.0"
1419

1520
lazy val jodaDeps = Seq(
1621
"org.joda" % "joda-convert" % "1.8.1",
17-
"joda-time" % "joda-time" % "2.9.2"
22+
"joda-time" % "joda-time" % "2.9.3"
1823
)
1924

2025
lazy val akkaDeps = Seq(
2126
// Akka is provided because Spark already includes it, and Spark's version is shaded so it's not safe
2227
// to use this one
23-
"com.typesafe.akka" %% "akka-slf4j" % "2.3.14" % "provided",
24-
"com.typesafe.akka" %% "akka-cluster" % "2.3.14" exclude("com.typesafe.akka", "akka-remote"),
28+
"com.typesafe.akka" %% "akka-slf4j" % "2.3.15" % "provided",
29+
"com.typesafe.akka" %% "akka-cluster" % "2.3.15" exclude("com.typesafe.akka", "akka-remote"),
2530
"io.spray" %% "spray-json" % "1.3.2",
2631
"io.spray" %% "spray-can" % "1.3.3",
2732
"io.spray" %% "spray-caching" % "1.3.3",
@@ -61,7 +66,7 @@ object Dependencies {
6166

6267
lazy val coreTestDeps = Seq(
6368
"org.scalatest" %% "scalatest" % "2.2.6" % "test",
64-
"com.typesafe.akka" %% "akka-testkit" % "2.3.14" % "test",
69+
"com.typesafe.akka" %% "akka-testkit" % "2.3.15" % "test",
6570
"io.spray" %% "spray-testkit" % "1.3.3" % "test"
6671
)
6772

project/plugins.sbt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10")
2+
13
addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2") // For quick restarts for web development
24

35
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")
@@ -8,7 +10,7 @@ addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
810

911
resolvers += Classpaths.sbtPluginReleases
1012

11-
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.2.0")
13+
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.3.5")
1214

1315
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.2.1")
1416

0 commit comments

Comments
 (0)