-
Notifications
You must be signed in to change notification settings - Fork 38
/
build.sbt
76 lines (67 loc) · 3.16 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
import com.typesafe.sbt.osgi.SbtOsgi
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._
import com.typesafe.tools.mima.core._
ThisBuild / scalaVersion := Version.scala212
val disablePublishingSettings = Seq(
// https://github.com/sbt/sbt/pull/3380
publish / skip := true,
publishArtifact := false,
mimaReportBinaryIssues := false
)
lazy val sslConfigCore = project.in(file("ssl-config-core"))
.settings(AutomaticModuleName.settings("ssl.config.core"))
.settings(osgiSettings: _*)
.settings(
crossScalaVersions := Seq(Version.scala213, Version.scala212, Version.scala211, Version.scala3),
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
name := "ssl-config-core",
mimaReportSignatureProblems := true,
mimaPreviousArtifacts := (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) =>
Set("0.5.0")
case _ =>
Set()
}).map("com.typesafe" %% "ssl-config-core" % _),
mimaBinaryIssueFilters ++= Seq(
// private[sslconfig]
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sslconfig.ssl.SSLLooseConfig.this"),
// private[sslconfig]
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sslconfig.ssl.SSLConfigSettings.this"),
// synthetic on private[sslconfig]
ProblemFilters.exclude[IncompatibleResultTypeProblem]("com.typesafe.sslconfig.ssl.SSLConfigSettings.<init>$default*")
),
libraryDependencies ++= Dependencies.sslConfigCore,
libraryDependencies ++= Dependencies.testDependencies,
OsgiKeys.bundleSymbolicName := s"${organization.value}.sslconfig",
OsgiKeys.exportPackage := Seq(s"com.typesafe.sslconfig.*;version=${version.value}"),
OsgiKeys.importPackage := Seq("!sun.misc", "!sun.security.*", configImport(), "*"),
OsgiKeys.requireCapability := """osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=1.8))"""",
).enablePlugins(SbtOsgi)
val documentation = project.enablePlugins(ParadoxPlugin, ParadoxSitePlugin).settings(
name := "SSL Config",
Paradox / siteSubdirName := "",
paradoxTheme := Some(builtinParadoxTheme("generic")),
disablePublishingSettings,
)
lazy val root = project.in(file("."))
.aggregate(
sslConfigCore,
documentation
)
.settings(disablePublishingSettings: _*)
def configImport(packageName: String = "com.typesafe.config.*") = versionedImport(packageName, "1.4.2", "1.5.0")
def versionedImport(packageName: String, lower: String, upper: String) = s"""$packageName;version="[$lower,$upper)""""
lazy val checkCodeFormat = taskKey[Unit]("Check that code format is following Scalariform rules")
checkCodeFormat := {
import scala.sys.process._
val exitCode = ("git diff --exit-code" !)
if (exitCode != 0) {
sys.error(
"""
|ERROR: Scalariform check failed, see differences above.
|To fix, format your sources using sbt scalariformFormat test:scalariformFormat before submitting a pull request.
|Additionally, please squash your commits (eg, use git commit --amend) if you're going to update this pull request.
""".stripMargin)
}
}
addCommandAlias("validateCode", ";scalariformFormat;test:scalariformFormat;headerCheck;test:headerCheck;checkCodeFormat")