-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
89 lines (67 loc) · 2.95 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
import com.typesafe.sbt.SbtGit.git
import _root_.sbtcrossproject.CrossPlugin.autoImport.CrossType
import microsites._
lazy val libs = org.typelevel.libraries
val apache2 = "Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")
val gh = GitHubSettings(org = "kailuowang", proj = "henkan", publishOrg = "com.kailuowang", license = apache2)
lazy val rootSettings = buildSettings ++ commonSettings ++ publishSettings ++ scoverageSettings
lazy val module = mkModuleFactory(gh.proj, mkConfig(rootSettings, commonJvmSettings, commonJsSettings))
lazy val prj = mkPrjFactory(rootSettings)
lazy val rootPrj = project
.configure(mkRootConfig(rootSettings,rootJVM))
.aggregate(rootJVM, rootJS, examples)
.settings(
noPublishSettings,
crossScalaVersions := Nil
)
lazy val rootJVM = project
.configure(mkRootJvmConfig(gh.proj, rootSettings, commonJvmSettings))
.aggregate(convertM.jvm, optionalM.jvm)
.settings(noPublishSettings,
crossScalaVersions := Nil)
lazy val rootJS = project
.configure(mkRootJsConfig(gh.proj, rootSettings, commonJsSettings))
.aggregate(convertM.js, optionalM.js)
.settings(
noPublishSettings,
crossScalaVersions := Nil
)
lazy val convert = prj(convertM)
lazy val convertM = module("convert", CrossType.Pure)
.settings(libs.dependency("shapeless"),
libs.testDependencies("specs2-core", "specs2-mock"))
.jsSettings(
libraryDependencies += "org.scala-js" %%% "scalajs-java-time" % "1.0.0" % Test
)
lazy val optional = prj(optionalM)
lazy val optionalM = module("optional", CrossType.Pure)
.settings(libs.dependencies("shapeless", "cats-core"),
libs.testDependencies("specs2-core", "specs2-mock"))
lazy val examples = project
.dependsOn(convert, optional)
.aggregate(convert, optional)
.settings(
moduleName := "henkan-examples",
commonSettings,
noPublishSettings,
libraryDependencies += "com.typesafe" % "config" % "1.4.2"
)
lazy val devKai = Developer("Kailuo Wang", "@kailuowang", "[email protected]", new java.net.URL("https://kailuowang.com"))
lazy val commonSettings = sharedCommonSettings ++ Seq(
Test / parallelExecution := false,
scalaVersion := libs.vers("scalac_2.12"),
crossScalaVersions := Seq(scalaVersion.value, libs.vers("scalac_2.13")),
developers := List(devKai)) ++ unidocCommonSettings ++ addCompilerPlugins(libs, "kind-projector") ++ Seq(
scalacOptions ++= (if(priorTo2_13(scalaVersion.value)) Nil else
Seq("-Ywarn-unused:-implicits", "-Xlint:-byname-implicit")),
)
lazy val buildSettings = sharedBuildSettings(gh, libs)
lazy val commonJvmSettings = Seq()
lazy val publishSettings = sharedPublishSettings(gh) ++ credentialSettings ++ sharedReleaseProcess
lazy val scoverageSettings = sharedScoverageSettings(60)
lazy val commonJsSettings = Seq(
scalaJSStage in Global := FastOptStage,
// currently sbt-doctest doesn't work in JS builds
// https://github.com/tkawachi/sbt-doctest/issues/52
doctestGenTests := Seq.empty
)