forked from scoverage/scalac-scoverage-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
100 lines (94 loc) · 3.62 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
import sbt._
import sbt.Keys._
import sbtrelease.ReleasePlugin.autoImport._
import com.typesafe.sbt.pgp.PgpKeys
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import org.scalajs.sbtplugin.cross.CrossProject
import org.scalajs.sbtplugin.cross.CrossType
val Org = "org.scoverage"
val MockitoVersion = "1.10.19"
val ScalatestVersion = "3.0.0"
val appSettings = Seq(
organization := Org,
scalaVersion := "2.12.0",
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0"),
fork in Test := false,
publishMavenStyle := true,
publishArtifact in Test := false,
parallelExecution in Test := false,
scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-encoding", "utf8"),
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
publishTo := {
if (isSnapshot.value)
Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
else
Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
},
pomExtra := {
<url>https://github.com/scoverage/scalac-scoverage-plugin</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:scoverage/scalac-scoverage-plugin.git</url>
<connection>scm:[email protected]:scoverage/scalac-scoverage-plugin.git</connection>
</scm>
<developers>
<developer>
<id>sksamuel</id>
<name>Stephen Samuel</name>
<url>http://github.com/sksamuel</url>
</developer>
</developers>
},
pomIncludeRepository := {
_ => false
}
) ++ Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value
)
lazy val root = Project("scalac-scoverage", file("."))
.settings(name := "scalac-scoverage")
.settings(appSettings: _*)
.settings(publishArtifact := false)
.aggregate(plugin, runtime.jvm, runtime.js)
lazy val runtime = CrossProject("scalac-scoverage-runtime", file("scalac-scoverage-runtime"), CrossType.Full)
.settings(name := "scalac-scoverage-runtime")
.settings(appSettings: _*)
.jvmSettings(
libraryDependencies ++= Seq(
"org.mockito" % "mockito-all" % MockitoVersion % "test",
"org.scalatest" %% "scalatest" % ScalatestVersion % "test"
)
)
.jsSettings(
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalatestVersion % "test",
scalaJSStage := FastOptStage,
inConfig(Test)(jsEnv := RhinoJSEnv().value)
)
lazy val `scalac-scoverage-runtimeJVM` = runtime.jvm
lazy val `scalac-scoverage-runtimeJS` = runtime.js
lazy val plugin = Project("scalac-scoverage-plugin", file("scalac-scoverage-plugin"))
.dependsOn(`scalac-scoverage-runtimeJVM` % "test")
.settings(name := "scalac-scoverage-plugin")
.settings(appSettings: _*)
.settings(libraryDependencies ++= Seq(
"org.mockito" % "mockito-all" % MockitoVersion % "test",
"org.scalatest" %% "scalatest" % ScalatestVersion % "test",
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided"
)).settings(libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor > 10 => Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.0.5",
"com.typesafe.scala-logging" %% "scala-logging" % "3.5.0" % "test"
)
case _ => Seq(
"com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2" % "test"
)
}
})