-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.sbt
114 lines (101 loc) · 3.4 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
import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings
import com.softwaremill.Publish.ossPublishSettings
val scala2_12 = "2.12.19"
val scala2_13 = "2.13.14"
val scala2 = List(scala2_12, scala2_13)
val scala3 = List("3.3.3")
val scalatestVersion = "3.2.19"
excludeLintKeys in Global ++= Set(ideSkipProject)
val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
organization := "com.softwaremill.odelay",
licenses := Seq(("MIT", url(s"https://github.com/softprops/odelay/blob/${version.value}/LICENSE")))
)
val commonJvmSettings = commonSettings ++ Seq(
ideSkipProject := (scalaVersion.value != scala2_13)
)
val commonJsSettings = commonSettings ++ Seq(
ideSkipProject := true
)
lazy val rootProject = (project in file("."))
.settings(commonSettings: _*)
.settings(publish / skip := true, name := "odelay", scalaVersion := scala2_13)
.aggregate(
core.projectRefs ++ testing.projectRefs ++ coreTests.projectRefs ++ netty3.projectRefs ++ netty.projectRefs ++ twitter.projectRefs: _*
)
lazy val core = (projectMatrix in file("odelay-core"))
.settings(
name := "odelay-core",
description := "provides api and jdk times as potential default"
)
.jvmPlatform(
scalaVersions = scala2 ++ scala3,
settings = commonJvmSettings
)
.jsPlatform(
scalaVersions = scala2 ++ scala3,
settings = commonJsSettings
)
lazy val testing = (projectMatrix in file("odelay-testing"))
.settings(
name := "odelay-testing",
libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion % Test,
publish / skip := true
)
.jvmPlatform(
scalaVersions = scala2 ++ scala3,
settings = commonJvmSettings
)
.jsPlatform(
scalaVersions = scala2 ++ scala3,
settings = commonJsSettings ++ Seq(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.4.0"
)
)
.dependsOn(core)
lazy val coreTests = (projectMatrix in file("odelay-core-tests"))
.settings(
name := "odelay-core-tests",
publish / skip := true
)
.jvmPlatform(
scalaVersions = scala2 ++ scala3,
settings = commonJvmSettings
)
.dependsOn(testing % "test->test")
lazy val netty3 = (projectMatrix in file("odelay-netty3"))
.settings(
name := "odelay-netty3",
description := "an odelay.Timer implementation backed by netty 3",
libraryDependencies += "io.netty" % "netty" % "3.10.6.Final"
)
.jvmPlatform(
scalaVersions = scala2 ++ scala3,
settings = commonJvmSettings
)
.dependsOn(core, testing % "test->test")
lazy val netty = (projectMatrix in file("odelay-netty"))
.settings(
name := "odelay-netty",
description := "an odelay.Timer implementation backed by netty 4",
libraryDependencies += "io.netty" % "netty-common" % "4.1.112.Final"
)
.jvmPlatform(
scalaVersions = scala2 ++ scala3,
settings = commonJvmSettings
)
.dependsOn(core, testing % "test->test")
lazy val twitter = (projectMatrix in file("odelay-twitter"))
.settings(
name := "odelay-twitter",
libraryDependencies := (scalaVersion.value match {
case rewrite if rewrite.startsWith("2.12") =>
Seq("com.twitter" %% "util-core" % "24.2.0")
case _ => Nil
}) ++ libraryDependencies.value,
description := "an odelay.Timer implementation backed by a com.twitter.util.Timer"
)
.jvmPlatform(
scalaVersions = List(scala2_12),
settings = commonJvmSettings
)
.dependsOn(core, testing % "test->test")