/
build.sbt
executable file
·121 lines (111 loc) · 5.61 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import play.sbt.PlayImport._
import sbt.Keys._
import sbt.Project.projectToRef
import sbtcrossproject.CrossPlugin.autoImport.crossProject
import webscalajs._
ThisBuild / organization := "org.scala-exercises"
ThisBuild / githubOrganization := "47degrees"
ThisBuild / scalaVersion := "2.13.3"
// Required to prevent errors for eviction from binary incompatible dependency
// resolutions.
// See also: https://github.com/scala-exercises/exercises-cats/pull/267
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always"
addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; testCovered")
addCommandAlias("ci-docs", "github; documentation/mdoc; headerCreateAll")
addCommandAlias("ci-publish", "github; ci-release")
lazy val `scala-exercises` = (project in file("."))
.settings(moduleName := "scala-exercises")
.settings((publish / skip) := true)
.aggregate(server, client, coreJs, coreJvm)
.dependsOn(server, client, coreJs, coreJvm)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.in(file("core"))
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % V.cats
)
)
lazy val coreJvm = core.jvm
lazy val coreJs = core.js.disablePlugins(ScoverageSbtPlugin)
lazy val server = (project in file("server"))
.aggregate(clients.map(projectToRef): _*)
.dependsOn(coreJvm)
.enablePlugins(PlayScala)
.enablePlugins(SbtWeb)
.enablePlugins(JavaAppPackaging)
.settings((publish / skip) := true)
.settings(
scalaJSProjects := clients,
(Assets / pipelineStages) := Seq(scalaJSPipeline),
pipelineStages := Seq(scalaJSProd, gzip),
routesGenerator := InjectedRoutesGenerator,
routesImport += "config.Routes._",
(Test / testOptions) := Seq(Tests.Argument(TestFrameworks.Specs2, "console")),
scalacOptions += "-Ymacro-annotations",
libraryDependencies ++= Seq(
filters,
jdbc,
evolutions,
cacheApi,
ws,
caffeine,
"org.scala-exercises" %% "runtime" % V.runtime,
"org.scala-exercises" %% "exercises-stdlib" % V.exercisesStdlib,
"org.scala-exercises" %% "exercises-cats" % V.exercisesCats,
"org.scala-exercises" %% "exercises-shapeless" % V.exercisesShapeless,
"org.scala-exercises" %% "exercises-scalatutorial" % V.exercisesScalatutorial,
"org.scala-exercises" %% "exercises-fpinscala" % V.exercisesFpinscala,
"org.scala-exercises" %% "exercises-doobie" % V.exercisesDoobie,
"org.scala-exercises" %% "exercises-scalacheck" % V.exercisesScalacheck,
"org.scala-exercises" %% "exercises-fetch" % V.exercisesFetch,
"org.scala-exercises" %% "exercises-monocle" % V.exercisesMonocle,
"org.scala-exercises" %% "exercises-circe" % V.exercisesCirce,
"com.vmunier" %% "scalajs-scripts" % V.scalajsscripts,
"com.lihaoyi" %% "upickle" % V.upickle,
"org.webjars" %% "webjars-play" % V.webjars,
"org.webjars" % "highlightjs" % V.highlightjs,
"org.foundweekends" %% "knockoff" % V.knockoff,
"com.newrelic.agent.java" % "newrelic-agent" % V.newrelic,
"org.typelevel" %% "cats-effect" % V.catsEffect,
"commons-io" % "commons-io" % V.commonsio,
"org.webjars.bower" % "bootstrap-sass" % V.bootstrap,
"com.47deg" %% "github4s" % V.github4s,
"org.scalatest" %% "scalatest" % V.scalatest % Runtime,
"org.scalatestplus" %% "scalacheck-1-14" % V.scalatestplusScheck % Test,
"org.tpolecat" %% "doobie-core" % V.doobie,
"org.tpolecat" %% "doobie-hikari" % V.doobie,
"org.tpolecat" %% "doobie-postgres" % V.doobie,
"com.dimafeng" %% "testcontainers-scala-scalatest" % V.testcontainers % Test,
"com.dimafeng" %% "testcontainers-scala-postgresql" % V.testcontainers % Test,
"com.github.alexarchambault" %% "scalacheck-shapeless_1.15" % V.scalacheckShapeless % Test,
"org.tpolecat" %% "doobie-scalatest" % V.doobie % Test
)
)
lazy val client = (project in file("client"))
.dependsOn(coreJs)
.enablePlugins(ScalaJSPlugin, ScalaJSWeb)
.disablePlugins(ScoverageSbtPlugin)
.settings(name := "client")
.settings((publish / skip) := true)
.settings(
scalaJSUseMainModuleInitializer := true,
(Test / scalaJSUseMainModuleInitializer) := false,
sourceMappings := SourceMappings.fromFiles(Seq(coreJs.base / "..")),
jsDependencies += "org.webjars" % "jquery" % V.jqueryWebjar / s"${V.jqueryWebjar}/jquery.js",
testFrameworks += new TestFramework("utest.runner.Framework"),
scalacOptions += "-Ymacro-annotations",
libraryDependencies ++= Seq(
"io.monix" %%% "monix" % V.monix,
"org.typelevel" %%% "cats-core" % V.cats,
"com.lihaoyi" %%% "scalatags" % V.jsDependencyScalatags,
"org.scala-js" %%% "scalajs-dom" % V.jsDependencyScalajsdom,
"be.doeraene" %%% "scalajs-jquery" % V.jsDependencyScalajsjquery,
"com.lihaoyi" %%% "upickle" % V.upickle,
"com.lihaoyi" %%% "utest" % V.jsDependencyUtest % Test
)
)
lazy val clients = Seq(client)
lazy val documentation = project
.settings(mdocOut := file("."))
.settings(publish / skip := true)
.enablePlugins(MdocPlugin)