-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
94 lines (68 loc) · 2.45 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
ThisBuild / organization := "com.albertprz"
ThisBuild / version := "1.0.0"
ThisBuild / Compile / compile / logLevel := Level.Warn
Global / excludeLintKeys += logLevel
Global / onChangedBuildSource := ReloadOnSourceChanges
Test / parallelExecution := false
val scala3Ver = "3.3.4"
val scala2Ver = "2.13.14"
lazy val commonSettings = Seq(
scalaVersion := scala3Ver,
scalafmtOnCompile := true,
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq("-Ytasty-reader")
case _ => Seq("-new-syntax", "-indent")
}),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => scalaReflect.map(_ % scalaVersion.value)
case _ => Seq()
})
)
lazy val coreSettings = Seq(
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => cats ++ catsEffect ++ pureconfig
case _ => cats ++ catsEffect ++ pureconfig.map(_.cross(CrossVersion.for3Use2_13))
})
)
lazy val testSettings = inConfig(IntegrationTest)(Defaults.itSettings) ++
Seq (
IntegrationTest / scalaSource := baseDirectory.value / "src/it/scala",
TaskKey[Unit]("test") := (IntegrationTest / test).dependsOn(Test / test).value,
libraryDependencies ++= (scalaTest ++ sqlite).map(_ % "it,test")
)
lazy val core = project
.in(file("core"))
.settings(
name := "logograph-core",
commonSettings,
coreSettings
)
lazy val macros = project
.in(file("macros"))
.settings(
name := "logograph-macros",
commonSettings,
crossScalaVersions := Seq(scala3Ver, scala2Ver)
)
.dependsOn(core)
lazy val app = project
.in(file("."))
.configs(IntegrationTest)
.settings(
name := "logograph",
commonSettings,
testSettings,
crossScalaVersions := Seq(scala3Ver, scala2Ver)
)
.dependsOn(core, macros)
.aggregate(core, macros)
/// Main Dependencies ///
val scalaReflect = Seq("org.scala-lang" % "scala-reflect")
val cats = Seq("org.typelevel" %% "cats-core" % "2.6.1",
"org.typelevel" %% "cats-kernel" % "2.6.1")
val catsEffect = Seq("org.typelevel" %% "cats-effect" % "3.1.1")
val pureconfig = Seq("com.github.pureconfig" %% "pureconfig" % "0.16.0")
/// Test Dependencies ///
val scalaTest = Seq("org.scalatest" %% "scalatest" % "3.2.9",
"org.scalactic" %% "scalactic" % "3.2.9")
val sqlite = Seq("org.xerial" % "sqlite-jdbc" % "3.47.1.0")