lila/project/BuildSettings.scala
Thibault Duplessis cdf2f56981 Revert "Merge branch 'scala-2.12-play-2.6' of github.com:ornicar/lila"
This reverts commit 2d3b4872c7, reversing
changes made to 04f1d4ae6d.
2017-09-09 10:01:35 -05:00

59 lines
1.8 KiB
Scala

import play.sbt.Play.autoImport._
import sbt._, Keys._
object BuildSettings {
import Dependencies._
val globalScalaVersion = "2.11.11"
def buildSettings = Defaults.coreDefaultSettings ++ Seq(
organization := "org.lichess",
scalaVersion := globalScalaVersion,
resolvers ++= Dependencies.Resolvers.commons,
scalacOptions := compilerOptions,
incOptions := incOptions.value.withNameHashing(true),
updateOptions := updateOptions.value.withCachedResolution(true),
sources in doc in Compile := List(),
// disable publishing the main API jar
publishArtifact in (Compile, packageDoc) := false,
// disable publishing the main sources jar
publishArtifact in (Compile, packageSrc) := false
)
def defaultDeps = Seq(scalaz, chess, scalalib, jodaTime, ws, java8compat, specs2)
def compile(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile")
def provided(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "provided")
def module(name: String, deps: Seq[sbt.ClasspathDep[sbt.ProjectReference]] = Seq.empty) =
Project(
name,
file("modules/" + name)
)
.dependsOn(deps: _*)
.settings(
version := "2.0",
libraryDependencies := defaultDeps,
buildSettings,
srcMain
)
val compilerOptions = Seq(
"-deprecation", "-unchecked", "-feature", "-language:_",
"-Xfatal-warnings",
"-Ywarn-dead-code",
// "-Ywarn-unused-import",
// "-Ywarn-unused",
// "-Xlint:missing-interpolator",
"-Ybackend:GenBCode", "-Ydelambdafy:method", "-target:jvm-1.8"
)
val srcMain = Seq(
scalaSource in Compile := (sourceDirectory in Compile).value,
scalaSource in Test := (sourceDirectory in Test).value
)
def projectToRef(p: Project): ProjectReference = LocalProject(p.id)
}