-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
104 lines (94 loc) · 3.5 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
import sbt.{ Def, Test }
ThisBuild / resolvers ++= Seq(
Resolver.mavenLocal,
"Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots/",
"Sonatype OSS Releases" at "https://s01.oss.sonatype.org/content/repositories/releases"
)
inThisBuild(
List(
organization := "org.bitlap",
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
homepage := Some(url("https://github.com/bitlap/smt")),
licenses := Seq(License.MIT),
developers := List(
Developer(
id = "dreamylost",
name = "梦境迷离",
email = "[email protected]",
url = url("https://blog.dreamylost.cn")
),
Developer(
id = "IceMimosa",
name = "ChenKai",
email = "[email protected]",
url = url("http://patamon.me")
)
)
)
)
lazy val scala212 = "2.12.19"
lazy val scala211 = "2.11.12"
lazy val scala213 = "2.13.13"
lazy val scalatestVersion = "3.2.19"
lazy val h2 = "2.3.230"
lazy val commonSettings =
Seq(
organization := "org.bitlap",
startYear := Some(2023),
scalaVersion := scala213,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided,
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided,
"org.scalatest" %% "scalatest" % scalatestVersion % Test
),
Compile / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 => Nil
case _ => List("-Ymacro-annotations", "-Ywarn-unused" /*, "-Ymacro-debug-verbose"*/ )
}
} ++ Seq("-language:experimental.macros"),
Compile / compile := (Compile / compile).dependsOn(Compile / headerCreateAll).value,
Global / onChangedBuildSource := ReloadOnSourceChanges,
headerLicense := Some(HeaderLicense.MIT("2023", "bitlap")),
Test / testOptions += Tests.Argument("-oDF"),
Test / fork := true,
publishConfiguration := publishConfiguration.value.withOverwrite(true),
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)
)
lazy val `smt-common` = (project in file("smt-common"))
.settings(commonSettings)
.settings(
name := "smt-common",
crossScalaVersions := List(scala213, scala212, scala211),
libraryDependencies += (
"com.h2database" % "h2" % h2 % Test
)
)
.settings(paradise())
.enablePlugins(HeaderPlugin)
lazy val `smt-annotations` = (project in file("smt-annotations"))
.settings(commonSettings)
.settings(
name := "smt-annotations",
crossScalaVersions := List(scala213, scala212, scala211)
)
.settings(paradise())
.enablePlugins(HeaderPlugin)
lazy val `smt` = (project in file("."))
.aggregate(
`smt-annotations`,
`smt-common`
)
.settings(
commands ++= Commands.value,
crossScalaVersions := Nil,
publish / skip := true,
headerLicense := Some(HeaderLicense.MIT("2023", "bitlap"))
)
def paradise(): Def.Setting[Seq[ModuleID]] =
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n < 13 => Some("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full)
case _ => None
}).fold(Seq.empty[ModuleID])(f => Seq(compilerPlugin(f)))
ThisBuild / logLevel := Level.Warn