2016-11-03 15:43:36 -06:00
|
|
|
import play.sbt.Play.autoImport._
|
2015-01-08 08:22:26 -07:00
|
|
|
import sbt._, Keys._
|
2013-03-14 12:16:36 -06:00
|
|
|
|
|
|
|
object BuildSettings {
|
|
|
|
|
|
|
|
import Dependencies._
|
|
|
|
|
2016-03-16 07:03:24 -06:00
|
|
|
val globalScalaVersion = "2.11.8"
|
2015-01-08 08:22:26 -07:00
|
|
|
|
2016-11-03 15:43:36 -06:00
|
|
|
def buildSettings = Defaults.coreDefaultSettings ++ Seq(
|
2013-03-14 12:16:36 -06:00
|
|
|
organization := "org.lichess",
|
2015-01-08 08:22:26 -07:00
|
|
|
scalaVersion := globalScalaVersion,
|
2013-03-14 12:16:36 -06:00
|
|
|
resolvers ++= Dependencies.Resolvers.commons,
|
2013-03-25 08:12:09 -06:00
|
|
|
parallelExecution in Test := false,
|
2013-05-29 03:10:11 -06:00
|
|
|
scalacOptions := compilerOptions,
|
2014-12-06 02:23:51 -07:00
|
|
|
incOptions := incOptions.value.withNameHashing(true),
|
2015-06-10 04:17:35 -06:00
|
|
|
updateOptions := updateOptions.value.withCachedResolution(true),
|
2015-07-22 03:33:40 -06:00
|
|
|
sources in doc in Compile := List(),
|
2015-07-22 03:36:41 -06:00
|
|
|
// disable publishing the main API jar
|
|
|
|
publishArtifact in (Compile, packageDoc) := false,
|
2015-07-22 03:33:40 -06:00
|
|
|
// disable publishing the main sources jar
|
2016-03-07 05:01:39 -07:00
|
|
|
publishArtifact in (Compile, packageSrc) := false
|
|
|
|
)
|
2013-03-14 12:16:36 -06:00
|
|
|
|
2016-03-16 07:52:46 -06:00
|
|
|
def defaultDeps = Seq(scalaz, scalalib, jodaTime, spray.util, ws, java8compat)
|
2013-03-14 12:16:36 -06:00
|
|
|
|
|
|
|
def compile(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile")
|
|
|
|
def provided(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "provided")
|
|
|
|
|
|
|
|
def project(name: String, deps: Seq[sbt.ClasspathDep[sbt.ProjectReference]] = Seq.empty) =
|
|
|
|
Project(
|
|
|
|
name,
|
2013-04-09 07:44:57 -06:00
|
|
|
file("modules/" + name),
|
2013-03-14 12:16:36 -06:00
|
|
|
dependencies = deps,
|
|
|
|
settings = Seq(
|
2014-06-01 15:54:55 -06:00
|
|
|
version := "2.0",
|
2013-03-14 12:16:36 -06:00
|
|
|
libraryDependencies := defaultDeps
|
2013-03-14 17:44:30 -06:00
|
|
|
) ++ buildSettings ++ srcMain
|
2013-03-14 12:16:36 -06:00
|
|
|
)
|
|
|
|
|
2016-03-16 07:52:46 -06:00
|
|
|
val compilerOptions = Seq(
|
|
|
|
"-deprecation", "-unchecked", "-feature", "-language:_",
|
2017-01-15 05:26:08 -07:00
|
|
|
// "-Xfatal-warnings",
|
2017-01-15 05:56:49 -07:00
|
|
|
// "-Ywarn-unused-import",
|
|
|
|
"-Ywarn-dead-code",
|
|
|
|
"-Ywarn-unused",
|
|
|
|
// "-Xlint:missing-interpolator",
|
2016-10-24 16:42:57 -06:00
|
|
|
"-Ybackend:GenBCode", "-Ydelambdafy:method", "-target:jvm-1.8")
|
2013-05-04 12:00:55 -06:00
|
|
|
|
2013-03-14 12:16:36 -06:00
|
|
|
val srcMain = Seq(
|
2016-11-03 15:43:36 -06:00
|
|
|
scalaSource in Compile := (sourceDirectory in Compile).value,
|
|
|
|
scalaSource in Test := (sourceDirectory in Test).value
|
2013-03-14 12:16:36 -06:00
|
|
|
)
|
2013-04-01 19:21:22 -06:00
|
|
|
|
2013-07-30 10:38:29 -06:00
|
|
|
def projectToRef(p: Project): ProjectReference = LocalProject(p.id)
|
2013-03-14 12:16:36 -06:00
|
|
|
}
|