-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
45 lines (39 loc) · 1.43 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
lazy val supportedVersions = List("2.13.3", "2.12.12")
enablePlugins(GitVersioning)
def publishSettings(): Seq[Def.Setting[_]] = (for {
repo <- sys.env.get("MAVEN_REPO_URL")
username <- sys.env.get("MAVEN_REPO_USER")
password <- sys.env.get("MAVEN_REPO_PASS")
host = url(repo).getHost
} yield Seq(
credentials += Credentials("GitHub Package Registry", host, username, password),
publishTo := {
Some("GitHub Package Registry" at repo)
}
)).getOrElse(Seq.empty)
ThisBuild / name := "memoize"
ThisBuild / organization := "se.randomserver"
ThisBuild / organizationHomepage := Some(url("https://github.com/randomserver"))
ThisBuild / organizationName := "randomserver.se"
ThisBuild / scalaVersion := "2.13.3"
ThisBuild / crossScalaVersions := supportedVersions
publishSettings()
git.useGitDescribe := true
Compile / sourceGenerators += task {
codegen.run((Compile / sourceManaged).value / "se/randomserver/memoize")
}
Compile / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 => Seq("-Ymacro-annotations")
case _ => Nil
}
}
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 =>
Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
case _ => Nil
}
} ++ Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
)