-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.sbt
131 lines (111 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
import com.typesafe.tools.mima.core._
ThisBuild / tlBaseVersion := "3.6"
ThisBuild / organization := "com.comcast"
ThisBuild / organizationName := "Comcast Cable Communications Management, LLC"
ThisBuild / tlSonatypeUseLegacyHost := true
ThisBuild / startYear := Some(2018)
ThisBuild / developers ++= List(
tlGitHubDev("mpilquist", "Michael Pilquist"),
tlGitHubDev("matthughes", "Matt Hughes"),
tlGitHubDev("nequissimus", "Tim Steinbach")
)
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"))
ThisBuild / crossScalaVersions := List("2.12.20", "2.13.15", "3.3.4")
ThisBuild / tlVersionIntroduced := Map("3" -> "3.0.3")
ThisBuild / doctestTestFramework := DoctestTestFramework.ScalaCheck
ThisBuild / initialCommands := "import com.comcast.ip4s._"
ThisBuild / mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.comcast.ip4s.IpAddress.toDefaultString"), // #553
ProblemFilters.exclude[DirectMissingMethodProblem]("com.comcast.ip4s.Ipv6Address.toInetAddress"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.comcast.ip4s.Dns.*"), // sealed trait
// Scala 3 (erroneously?) considered Multicast/SourceSpecificMulticast as sum types
ProblemFilters.exclude[DirectMissingMethodProblem]("com.comcast.ip4s.Multicast.ordinal"),
ProblemFilters.exclude[MissingTypesProblem]("com.comcast.ip4s.Multicast$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("com.comcast.ip4s.SourceSpecificMulticast.ordinal"),
ProblemFilters.exclude[MissingTypesProblem]("com.comcast.ip4s.SourceSpecificMulticast$"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.comcast.ip4s.IpAddress.isPrivate"), // #562
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.comcast.ip4s.IpAddress.isLoopback"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.comcast.ip4s.IpAddress.isLinkLocal")
)
lazy val root = tlCrossRootProject.aggregate(core, testKit)
lazy val testKit = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("./test-kit"))
.settings(commonSettings)
.settings(
name := "ip4s-test-kit"
)
.settings(mimaPreviousArtifacts := Set.empty)
.settings(
libraryDependencies ++= Seq(
"org.scalacheck" %%% "scalacheck" % "1.17.1",
"org.scalameta" %%% "munit-scalacheck" % "1.0.0-M11" % Test,
"org.typelevel" %%% "munit-cats-effect" % "2.0.0" % Test
)
)
.jvmSettings(
libraryDependencies += "com.google.guava" % "guava" % "33.3.1-jre" % "test"
)
.dependsOn(core % "compile->compile")
lazy val testKitJVM = testKit.jvm
lazy val testKitJS = testKit.js
.disablePlugins(DoctestPlugin)
.enablePlugins(ScalaJSBundlerPlugin)
lazy val testKitNative = testKit.js
.disablePlugins(DoctestPlugin)
.settings(commonNativeSettings)
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("."))
.settings(commonSettings)
.settings(
name := "ip4s-core",
libraryDependencies ++= {
if (tlIsScala3.value) Nil
else List("org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided")
},
scalacOptions := scalacOptions.value.filterNot(_ == "-source:3.0-migration")
)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "literally" % "1.1.0",
"org.typelevel" %%% "cats-core" % "2.10.0",
"org.typelevel" %%% "cats-effect" % "3.5.5",
"org.scalacheck" %%% "scalacheck" % "1.17.1" % Test
)
)
.nativeSettings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "idna4s-core" % "0.0.1"
)
)
lazy val coreJVM = core.jvm.settings(
doctestIgnoreRegex := Some(".*Literals.scala")
)
lazy val coreJS = core.js
.disablePlugins(DoctestPlugin)
.enablePlugins(ScalaJSBundlerPlugin)
.settings(
Compile / npmDependencies += "punycode" -> "2.1.1",
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
)
lazy val coreNative = core.native
.disablePlugins(DoctestPlugin)
.settings(commonNativeSettings)
lazy val docs = project
.in(file("docs"))
.enablePlugins(MdocPlugin)
.dependsOn(coreJVM)
.settings(
mdocIn := baseDirectory.value / "src",
mdocOut := baseDirectory.value / "../docs",
githubWorkflowArtifactUpload := false,
libraryDependencies += "org.typelevel" %%% "cats-effect" % "3.5.5"
)
lazy val commonSettings = Seq(
Compile / unmanagedResources ++= {
val base = baseDirectory.value / ".."
(base / "NOTICE") +: (base / "LICENSE") +: (base / "CONTRIBUTING") +: ((base / "licenses") * "LICENSE_*").get
}
)
lazy val commonNativeSettings = Seq(
tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "3.1.4").toMap
)