-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
160 lines (137 loc) · 4.68 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// Scala versions
val scala213 = "2.13.15"
val scala212 = "2.12.20"
val scala3 = "3.3.4"
val scala2 = List(scala213, scala212)
val scalaVersions = scala3 :: scala2
name := "fabric"
ThisBuild / tlBaseVersion := "1.15"
ThisBuild / organization := "org.typelevel"
ThisBuild / startYear := Some(2021)
ThisBuild / licenses := Seq(License.MIT)
ThisBuild / scalaVersion := scala3
ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
ThisBuild / crossScalaVersions := scalaVersions
ThisBuild / tlSonatypeUseLegacyHost := false
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / sonatypeProfileName := "org.typelevel"
ThisBuild / licenses := Seq(
"MIT" -> url("https://github.com/typelevel/fabric/blob/master/LICENSE")
)
ThisBuild / sonatypeProjectHosting := Some(
xerial.sbt.Sonatype.GitHubHosting("typelevel", "fabric", "[email protected]")
)
ThisBuild / homepage := Some(url("https://github.com/typelevel/fabric"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/typelevel/fabric"),
"scm:[email protected]:typelevel/fabric.git"
)
)
ThisBuild / developers := List(tlGitHubDev("darkfrog26", "Matt Hicks"))
// Dependency versions
val collectionCompatVersion: String = "2.12.0"
val reactifyVersion: String = "4.1.3"
val scalaTestVersion: String = "3.2.19"
val scalaCheckVersion: String = "3.2.19.0"
// Parse module dependencies
val literallyVersion: String = "1.2.0"
val jacksonVersion: String = "2.18.1"
val apacheCommonsTextVersion: String = "1.12.0"
val typesafeConfigVersion: String = "1.4.3"
val jsoniterJavaVersion: String = "0.9.23"
// Benchmarks
val circeVersion: String = "0.14.7"
val uPickleVersion: String = "3.3.1"
lazy val root = tlCrossRootProject.aggregate(
core.js,
core.jvm,
core.native,
io.js,
io.jvm,
reactify.js,
reactify.jvm,
reactify.native
)
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.settings(
name := "fabric-core",
mimaPreviousArtifacts := Set.empty,
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test,
"org.scalatestplus" %%% "scalacheck-1-18" % scalaCheckVersion % Test
),
libraryDependencies ++= (
if (scalaVersion.value.startsWith("3")) {
Nil
} else {
Seq(
"org.scala-lang.modules" %%% "scala-collection-compat" % collectionCompatVersion,
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)
}
),
Compile / unmanagedSourceDirectories ++= {
val major = if (scalaVersion.value.startsWith("3")) "-3" else "-2"
List(CrossType.Pure, CrossType.Full).flatMap(
_.sharedSrcDir(baseDirectory.value, "main").toList.map(f => file(f.getPath + major))
)
}
)
lazy val io = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.settings(
name := "fabric-io",
mimaPreviousArtifacts := Set.empty,
libraryDependencies ++= Seq(
"org.typelevel" %%% "literally" % literallyVersion,
"com.jsoniter" % "jsoniter" % jsoniterJavaVersion,
"com.fasterxml.jackson.core" % "jackson-core" % jacksonVersion % Provided,
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test,
"org.scalatestplus" %%% "scalacheck-1-18" % scalaCheckVersion % Test
)
)
.jvmSettings(
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-text" % apacheCommonsTextVersion,
"com.fasterxml.jackson.core" % "jackson-core" % jacksonVersion,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % jacksonVersion,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % jacksonVersion,
"com.typesafe" % "config" % typesafeConfigVersion
)
)
.dependsOn(core)
lazy val reactify = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.settings(
name := "fabric-reactify",
mimaPreviousArtifacts := Set.empty,
libraryDependencies ++= Seq(
"com.outr" %%% "reactify" % reactifyVersion,
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test,
"org.scalatestplus" %%% "scalacheck-1-18" % scalaCheckVersion % Test
)
)
.dependsOn(core)
lazy val bench = project
.in(file("bench"))
.enablePlugins(JmhPlugin)
.dependsOn(io.jvm)
.settings(
name := "fabric-benchmarks",
libraryDependencies ++= Seq(
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"com.lihaoyi" %% "upickle" % uPickleVersion
)
)
lazy val docs = project
.in(file("documentation"))
.dependsOn(io.jvm)
.enablePlugins(MdocPlugin)
.settings(
mdocVariables := Map("VERSION" -> version.value),
mdocOut := file(".")
)
lazy val util = project.in(file("util"))