-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
executable file
·143 lines (131 loc) · 4.55 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
// Scala versions
val scala213 = "2.13.9"
val scala3 = List("3.2.0")
val scala2 = List(scala213)
val scalaVersions = scala3 ::: scala2
name := "fabric"
ThisBuild / organization := "com.outr"
ThisBuild / version := "1.6.1"
ThisBuild / scalaVersion := scala213
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation")
ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
ThisBuild / crossScalaVersions := scalaVersions
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / sonatypeProfileName := "com.outr"
ThisBuild / licenses := Seq("MIT" -> url("https://github.com/outr/fabric/blob/master/LICENSE"))
ThisBuild / sonatypeProjectHosting := Some(xerial.sbt.Sonatype.GitHubHosting("outr", "fabric", "[email protected]"))
ThisBuild / homepage := Some(url("https://github.com/outr/fabric"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/outr/fabric"),
"scm:[email protected]:outr/fabric.git"
)
)
ThisBuild / developers := List(
Developer(id="darkfrog", name="Matt Hicks", email="[email protected]", url=url("https://matthicks.com"))
)
// Dependency versions
val collectionCompatVersion: String = "2.8.1"
val scalaTestVersion: String = "3.2.13"
val scalaCheckVersion: String = "3.2.13.0"
// Parse module dependencies
val jacksonVersion: String = "2.13.4"
val typesafeConfigVersion: String = "1.4.2"
val jsoniterJavaVersion: String = "0.9.23"
// Benchmarks
val circeVersion: String = "0.14.2"
val uPickleVersion: String = "2.0.0"
// set source map paths from local directories to github path
val sourceMapSettings = List(
scalacOptions ++= git.gitHeadCommit.value.map { headCommit =>
val local = baseDirectory.value.toURI
val remote = s"https://raw.githubusercontent.com/outr/fabric/$headCommit/"
s"-P:scalajs:mapSourceURI:$local->$remote"
}
)
lazy val root = project.in(file("."))
.aggregate(
core.js, core.jvm, core.native, io.js, io.jvm, define.jvm
)
.settings(
name := "fabric",
publish := {},
publishLocal := {}
)
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.settings(
name := "fabric-core",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test,
"org.scalatestplus" %%% "scalacheck-1-16" % 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",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test,
"org.scalatestplus" %% "scalacheck-1-16" % scalaCheckVersion % Test
)
)
.jvmSettings(
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-core" % jacksonVersion,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % jacksonVersion,
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % jacksonVersion,
"com.jsoniter" % "jsoniter" % jsoniterJavaVersion,
"com.typesafe" % "config" % typesafeConfigVersion
)
)
.dependsOn(core)
lazy val define = crossProject(JVMPlatform)
.crossType(CrossType.Full)
.settings(
name := "fabric-define",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test,
"org.scalatestplus" %% "scalacheck-1-16" % scalaCheckVersion % Test
)
)
.dependsOn(io)
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(".")
)