-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
84 lines (71 loc) · 2.23 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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
name := "teseo"
inThisBuild(
List(
scalaVersion := "3.3.1",
organization := "io.github.pablf",
homepage := Some(url("https://github.com/pablf/teseo")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"pablf",
"Pablo Femenía",
url("https://github.com/pablf/teseo")
)
)
)
)
fork in Test := true
scalacOptions += "-Ywarn-unused"
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
addCommandAlias("fmt", "; all scalafmtSbt scalafmtAll")
addCommandAlias("check", "; scalafmtSbtCheck; scalafmtCheckAll")
addCommandAlias(
"testJVM",
";core/test"
)
val scalatestVersion = "3.2.17"
def mkSettings(platform: String, conf: String, baseDirectory: File) =
for {
platform <- List("shared", platform)
result = baseDirectory.getParentFile / platform.toLowerCase / "src" / conf / "scala"
if result.exists
} yield result
lazy val settings = Seq(
Compile / unmanagedSourceDirectories ++= {
mkSettings(
crossProjectPlatform.value.identifier,
"main",
baseDirectory.value
)
},
Test / unmanagedSourceDirectories ++= {
mkSettings(
crossProjectPlatform.value.identifier,
"test",
baseDirectory.value
)
}
)
lazy val root = project
.in(file("."))
.aggregate(teseo.jvm, teseo.native)
lazy val teseo = crossProject(JVMPlatform, NativePlatform, JSPlatform)
.in(file("teseo"))
.settings(name := "teseo")
.settings(settings)
.settings(libraryDependencies += "org.scalatest" %% "scalatest" % scalatestVersion % Test)
.settings(scalacOptions += "-language:experimental.macros")
.settings(scalacOptions += "-language:experimental")
lazy val examples = crossProject(JVMPlatform, NativePlatform, JSPlatform)
.in(file("examples"))
.settings(name := "teseo-examples")
.settings(settings)
.dependsOn(teseo)
lazy val docs = project
.in(file("teseo-docs"))
.dependsOn(teseo.jvm)
.enablePlugins(MdocPlugin)
Global / onChangedBuildSource := ReloadOnSourceChanges