Tweaks and scalalib upgrade
This commit is contained in:
parent
91162c6164
commit
65864115d5
|
@ -21,7 +21,7 @@ trait Dependencies {
|
||||||
val slf4j = "org.slf4j" % "slf4j-nop" % "1.6.4"
|
val slf4j = "org.slf4j" % "slf4j-nop" % "1.6.4"
|
||||||
val instrumenter = "com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % "2.0"
|
val instrumenter = "com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % "2.0"
|
||||||
val gson = "com.google.code.gson" % "gson" % "1.7.1"
|
val gson = "com.google.code.gson" % "gson" % "1.7.1"
|
||||||
val scalalib = "com.github.ornicar" %% "scalalib" % "1.15"
|
val scalalib = "com.github.ornicar" %% "scalalib" % "1.16"
|
||||||
val hasher = "com.roundeights" % "hasher" % "0.3" from "http://cloud.github.com/downloads/Nycto/Hasher/hasher_2.9.1-0.3.jar"
|
val hasher = "com.roundeights" % "hasher" % "0.3" from "http://cloud.github.com/downloads/Nycto/Hasher/hasher_2.9.1-0.3.jar"
|
||||||
val config = "com.typesafe.config" % "config" % "0.2.1"
|
val config = "com.typesafe.config" % "config" % "0.2.1"
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ object ApplicationBuild extends Build with Resolvers with Dependencies {
|
||||||
version := "0.1",
|
version := "0.1",
|
||||||
scalaVersion := "2.9.1",
|
scalaVersion := "2.9.1",
|
||||||
resolvers := Seq(iliaz, codahale, sonatype, novusS, typesafe),
|
resolvers := Seq(iliaz, codahale, sonatype, novusS, typesafe),
|
||||||
|
libraryDependencies := Seq(scalalib),
|
||||||
libraryDependencies in test := Seq(specs2),
|
libraryDependencies in test := Seq(specs2),
|
||||||
shellPrompt := {
|
shellPrompt := {
|
||||||
(state: State) ⇒ "%s> ".format(Project.extract(state).currentProject.id)
|
(state: State) ⇒ "%s> ".format(Project.extract(state).currentProject.id)
|
||||||
|
@ -41,21 +42,21 @@ object ApplicationBuild extends Build with Resolvers with Dependencies {
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val chess = Project("chess", file("chess"), settings = buildSettings).settings(
|
lazy val chess = Project("chess", file("chess"), settings = buildSettings).settings(
|
||||||
libraryDependencies := Seq(scalalib, hasher)
|
libraryDependencies ++= Seq(hasher)
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val system = Project("system", file("system"), settings = buildSettings).settings(
|
lazy val system = Project("system", file("system"), settings = buildSettings).settings(
|
||||||
libraryDependencies := Seq(scalalib, scalaz, config, redis, json, casbah, salat, slf4j)
|
libraryDependencies ++= Seq(scalaz, config, redis, json, casbah, salat, slf4j)
|
||||||
) dependsOn (chess)
|
) dependsOn (chess)
|
||||||
|
|
||||||
lazy val http = Project("http", file("http"), settings = buildSettings).settings(
|
lazy val http = Project("http", file("http"), settings = buildSettings).settings(
|
||||||
libraryDependencies := Seq(scalalib, scalaz, slf4j),
|
libraryDependencies ++= Seq(scalaz, slf4j),
|
||||||
resolvers := Seq(typesafe, typesafeS)
|
resolvers := Seq(typesafe, typesafeS)
|
||||||
) dependsOn (system)
|
) dependsOn (system)
|
||||||
|
|
||||||
lazy val benchmark = Project("benchmark", file("benchmark"), settings = buildSettings).settings(
|
lazy val benchmark = Project("benchmark", file("benchmark"), settings = buildSettings).settings(
|
||||||
fork in run := true,
|
fork in run := true,
|
||||||
libraryDependencies := Seq(scalalib, instrumenter, gson),
|
libraryDependencies ++= Seq(instrumenter, gson),
|
||||||
// we need to add the runtime classpath as a "-cp" argument
|
// we need to add the runtime classpath as a "-cp" argument
|
||||||
// to the `javaOptions in run`, otherwise caliper
|
// to the `javaOptions in run`, otherwise caliper
|
||||||
// will not see the right classpath and die with a ConfigurationException
|
// will not see the right classpath and die with a ConfigurationException
|
||||||
|
|
|
@ -9,8 +9,7 @@ import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
|
|
||||||
class GameRepo(collection: MongoCollection)
|
class GameRepo(collection: MongoCollection) extends SalatDAO[DbGame, String](collection) {
|
||||||
extends SalatDAO[DbGame, String](collection) {
|
|
||||||
|
|
||||||
def game(id: String): Option[DbGame] = findOneByID(id)
|
def game(id: String): Option[DbGame] = findOneByID(id)
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,7 @@ trait EnvBuilder {
|
||||||
case (config, source) if source isEmpty ⇒ config
|
case (config, source) if source isEmpty ⇒ config
|
||||||
case (config, source) if source contains '=' ⇒
|
case (config, source) if source contains '=' ⇒
|
||||||
config.withFallback(ConfigFactory parseString source)
|
config.withFallback(ConfigFactory parseString source)
|
||||||
case (config, source) if source contains '.' ⇒
|
|
||||||
config.withFallback(ConfigFactory parseFile (new File(source)))
|
|
||||||
case (config, source) ⇒
|
case (config, source) ⇒
|
||||||
config.withFallback(ConfigFactory load source)
|
config.withFallback(ConfigFactory parseFile (new File(source)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue