forked from shogowada/statictags
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
108 lines (98 loc) · 3.28 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
import org.scalajs.jsenv.nodejs.NodeJSEnv
import sbtcrossproject.CrossProject
import scoverage.ScoverageKeys.{coverageEnabled, coverageScalacPluginVersion}
val commonSettings = Seq(
organization := "org.scommons.shogowada",
name := "statictags",
scalaVersion := "2.13.1",
scalacOptions ++= Seq(
"-deprecation", "-unchecked", "-feature", "-Xcheckinit", "-target:jvm-1.8", "-Xfatal-warnings"
),
parallelExecution in Test := false,
sonatypeProfileName := "org.scommons",
publishMavenStyle := true,
publishArtifact in Test := false,
publishTo := sonatypePublishToBundle.value,
pomExtra := {
<url>https://github.com/scommons/statictags</url>
<licenses>
<license>
<name>MIT</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:scommons/statictags.git</url>
<connection>scm:git@github.com:scommons/statictags.git</connection>
</scm>
<developers>
<developer>
<id>shogowada</id>
<name>Shogo Wada</name>
<url>https://github.com/shogowada</url>
</developer>
<developer>
<id>viktorp</id>
<name>Viktor Podzigun</name>
<url>https://github.com/viktor-podzigun</url>
</developer>
</developers>
},
pomIncludeRepository := {
_ => false
}
)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(
skip in publish := true,
publish := ((): Unit),
publishLocal := ((): Unit),
publishM2 := ((): Unit)
)
.aggregate(jvm, js)
lazy val statictags = CrossProject("statictags", file("statictags"))(JSPlatform, JVMPlatform)
.crossType(sbtcrossproject.CrossType.Pure)
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.2.2" % "test"
)
)
.jsSettings(
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
.withSourceMap(false)
.withESFeatures(_.withUseECMAScript2015(false))
},
// required for node.js >= v12.12.0
// see:
// https://github.com/nodejs/node/pull/29919
scalaJSLinkerConfig in Test ~= {
_.withSourceMap(true)
},
jsEnv in Test := new NodeJSEnv(NodeJSEnv.Config().withArgs(List("--enable-source-maps"))),
//TODO: remove these temporal fixes for Scala.js 1.1+ and scoverage
coverageScalacPluginVersion := {
val current = coverageScalacPluginVersion.value
if (scalaJSVersion.startsWith("0.6")) current
else "1.4.2" //the only version that supports Scala.js 1.1+
},
libraryDependencies ~= { modules =>
if (scalaJSVersion.startsWith("0.6")) modules
else modules.filter(_.organization != "org.scoverage")
},
libraryDependencies ++= {
if (coverageEnabled.value) {
if (scalaJSVersion.startsWith("0.6")) Nil
else Seq(
"org.scoverage" %% "scalac-scoverage-runtime_sjs1" % coverageScalacPluginVersion.value,
"org.scoverage" %% "scalac-scoverage-plugin" % coverageScalacPluginVersion.value % "scoveragePlugin"
)
}
else Nil
}
)
lazy val jvm = statictags.jvm
lazy val js = statictags.js