forked from tofu-tf/derevo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
114 lines (105 loc) · 4.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
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
name := "derevo"
import com.typesafe.sbt.SbtGit.git
val publishVersion = "0.11.4"
val common = List(
scalaVersion := "2.13.1",
crossScalaVersions := List("2.12.11", "2.13.2"),
libraryDependencies += scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided,
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 11 | 12)) => List(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.patch))
case _ => List()
}
},
libraryDependencies += compilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.patch),
scalacOptions ++= Vector(
"-deprecation",
"-feature",
"-language:experimental.macros",
"-language:higherKinds",
"-Xfatal-warnings",
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) if y == 11 => Seq("-Xexperimental")
case Some((2, y)) if y == 13 => Seq("-Ymacro-annotations")
case _ => Seq.empty[String]
}
},
publishMavenStyle := true,
homepage := Some(url("https://manatki.org/docs/derevo")),
scmInfo := Some(
ScmInfo(
url("https://github.com/manatki/derevo"),
"[email protected]:manatki/derevo.git"
)
),
publishTo := {
if (isSnapshot.value) {
Some(Opts.resolver.sonatypeSnapshots)
} else sonatypePublishToBundle.value
},
developers := List(
Developer(
"odomontois",
"Oleg Nizhnik",
url("https://github.com/odomontois")
)
),
credentials ++= ((Path.userHome / ".sbt" / "odo.credentials") :: Nil)
.filter(_.exists())
.map(Credentials.apply),
pgpSecretRing := Path.userHome / ".gnupg" / "secring.gpg",
organization := "org.manatki",
version := {
val branch = git.gitCurrentBranch.value
if (branch == "master") publishVersion
else s"$publishVersion-$branch-SNAPSHOT"
},
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
)
lazy val core = project settings common settings (
Compile / resourceGenerators += Def.task {
val rootFolder = (Compile / resourceManaged).value / "META-INF"
rootFolder.mkdirs()
val integrationVersion = (intellijIntegration / version).value
val integrationName = (intellijIntegration / name).value
val integrationOrg = (intellijIntegration / organization).value
val intellijCompatFile = rootFolder / "intellij-compat.json"
IO.write(
intellijCompatFile,
s"""{"artifact": "$integrationOrg % ${integrationName}_2.12 % $integrationVersion"}""".stripMargin
)
Seq(intellijCompatFile)
}
)
lazy val cats = project dependsOn core settings common
lazy val circe = project dependsOn core settings common
lazy val circeMagnolia = project dependsOn core settings common
lazy val ciris = project dependsOn core settings common settings (scalacOptions -= "-Xfatal-warnings")
lazy val tethys = project dependsOn core settings common
lazy val tethysMagnolia = project dependsOn core settings common
lazy val tschema = project dependsOn core settings common
lazy val reactivemongo = project dependsOn core settings common
lazy val catsTagless = project dependsOn core settings common
lazy val pureconfig = project dependsOn core settings common
lazy val scalacheck = project dependsOn core settings common
intellijPluginName in ThisBuild := "intellij-derevo"
intellijBuild in ThisBuild := "201.7223.91"
lazy val intellijIntegration =
project
.enablePlugins(SbtIdeaPlugin)
.settings(common)
.settings(
name := "derevo-intellij-integration",
version := "0.1.0",
intellijPlugins += "org.intellij.scala".toPlugin,
scalaVersion := "2.12.11",
packageMethod := PackagingMethod.Standalone()
)
lazy val derevo = project in file(".") settings (common, skip in publish := true) aggregate (
core, cats, circe, circeMagnolia, ciris, tethys, tschema, reactivemongo, catsTagless, pureconfig, scalacheck
)
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("checkfmt", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")