-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.sbt
102 lines (90 loc) · 3.47 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
import xerial.sbt.Sonatype._
lazy val scala213 = "2.13.1"
lazy val scala212 = "2.12.11"
lazy val scala211 = "2.11.12"
lazy val supportedScalaVersions = List(scala211, scala212, scala213)
ThisBuild / organization := "com.olegpy"
ThisBuild / version := "0.3.1"
ThisBuild / licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
ThisBuild / homepage := Some(url("http://github.com/oleg-py/better-monadic-for"))
ThisBuild / scalaVersion := Option(System.getenv("SCALA_VERSION")).filter(_.nonEmpty).getOrElse(scala213)
val testSettings = Seq(
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.2" % Test,
Test / scalacOptions ++= {
val jar = (betterMonadicFor / Compile / packageBin).value
Seq(s"-Xplugin:${jar.getAbsolutePath}", s"-Jdummy=${jar.lastModified}") // ensures recompile
},
Test / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 11)) => Seq.empty
case _ => Seq("-Ywarn-unused:locals")
}
},
publish / skip := true
)
lazy val root = (project in file("."))
.aggregate(betterMonadicFor, pluginTests, catsTests, scalazTests)
.settings(
crossScalaVersions := Nil,
publish / skip := true
)
lazy val betterMonadicFor = (project in file("better-monadic-for"))
.settings(
name := "better-monadic-for",
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= Seq(
scalaOrganization.value % "scala-compiler" % scalaVersion.value,
),
publishTo := sonatypePublishTo.value,
publishMavenStyle := true,
sonatypeProjectHosting := Some(GitHubHosting("oleg-py", "better-monadic-for", "[email protected]")),
)
lazy val pluginTests = (project in file("plugin-tests"))
.dependsOn(betterMonadicFor)
.settings(crossScalaVersions := supportedScalaVersions)
.settings(testSettings)
lazy val pcplodTests = (project in file("pcplod-tests"))
.dependsOn(pluginTests % "compile->compile;test->test")
.settings(
name := "pcplod-tests",
crossScalaVersions := List(scala211, scala212),
libraryDependencies ++= Seq(
"org.ensime" %% "pcplod" % "1.2.1" % Test
),
// WORKAROUND https://github.com/ensime/pcplod/issues/12
fork in Test := true,
javaOptions in Test ++= Seq(
s"""-Dpcplod.settings=${(scalacOptions in Test).value.filterNot(_.contains(",")).mkString(",")}""",
s"""-Dpcplod.classpath=${(fullClasspath in Test).value.map(_.data).mkString(",")}"""
)
)
.settings(testSettings)
lazy val catsTests = (project in file("cats-tests"))
.dependsOn(pluginTests % "compile->compile;test->test")
.settings(
name := "cats-tests",
crossScalaVersions := List(scala211, scala212),
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.0.0" % Test
)
)
.settings(testSettings)
lazy val scalazTests = (project in file("scalaz-tests"))
.dependsOn(pluginTests % "compile->compile;test->test")
.settings(
name := "scalaz-tests",
crossScalaVersions := List(scala211, scala212),
libraryDependencies ++= Seq(
"org.scalaz" %% "scalaz-core" % "7.2.27" % Test,
)
)
.settings(testSettings)
lazy val wartRemoverTests = (project in file("wartremover-tests"))
.dependsOn(pluginTests % "compile->compile;test->test")
.settings(
name := "wartremover-tests",
crossScalaVersions := List(scala212),
addCompilerPlugin("org.wartremover" %% "wartremover" % "2.4.2"),
scalacOptions += "-P:wartremover:traverser:org.wartremover.warts.NonUnitStatements"
)
.settings(testSettings)