forked from scoverage/scalac-scoverage-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
114 lines (108 loc) · 3.88 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
import sbt._
import sbt.Keys._
import sbtrelease.ReleasePlugin.autoImport._
import com.typesafe.sbt.pgp.PgpKeys
import sbtcrossproject.CrossProject
import sbtcrossproject.CrossType
val Org = "com.twitter.scoverage"
val ScalatestVersion = "3.1.1"
val appSettings = Seq(
organization := Org,
scalaVersion := "2.12.13",
crossScalaVersions := Seq("2.10.7", "2.11.12", "2.12.13", "2.13.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),
useGpg := true,
credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials"),
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/twitter-forks/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]/twitter-forks/scalac-scoverage-plugin.git</url>
<connection>scm:[email protected]/twitter-forks/scalac-scoverage-plugin.git</connection>
</scm>
<developers>
<developer>
<id>sksamuel</id>
<name>Stephen Samuel</name>
<url>http://github.com/sksamuel</url>
</developer>
<developer>
<id>gslowikowski</id>
<name>Grzegorz Slowikowski</name>
<url>http://github.com/gslowikowski</url>
</developer>
</developers>
},
pomIncludeRepository := {
_ => false
}
) ++ Seq(
releaseCrossBuild := true,
)
lazy val root = Project("scalac-scoverage", file("."))
.settings(name := "scalac-scoverage")
.settings(appSettings: _*)
.settings(publishArtifact := false)
.settings(publishLocal := {})
.aggregate(plugin, runtime.jvm, runtime.js)
lazy val runtime = CrossProject("scalac-scoverage-runtime", file("scalac-scoverage-runtime"))(JVMPlatform, JSPlatform)
.crossType(CrossType.Full)
.settings(name := "scalac-scoverage-runtime")
.settings(appSettings: _*)
.jvmSettings(
fork in Test := true,
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % ScalatestVersion % "test"
)
)
.jsSettings(
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalatestVersion % "test",
scalaJSStage := FastOptStage
)
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.scalatest" %% "scalatest" % ScalatestVersion % "test",
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided"
)
)
.settings(
unmanagedSourceDirectories in Test ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor > 10 =>
Seq((sourceDirectory in Test).value / "scala-2.11+")
case _ =>
Seq()
}
},
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor > 10 =>
Seq("org.scala-lang.modules" %% "scala-xml" % "1.2.0")
case _ =>
Seq()
}
}
)