-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
96 lines (85 loc) · 3 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
inThisBuild(Seq(
version := "1.1.1-SNAPSHOT",
organization := "org.scala-js",
crossScalaVersions := Seq("2.12.10", "2.11.12", "2.13.1"),
scalaVersion := crossScalaVersions.value.head,
scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings"),
homepage := Some(url("https://www.scala-js.org/")),
licenses += ("BSD New",
url("https://github.com/scala-js/scala-js-env-jsdom-nodejs/blob/main/LICENSE")),
scmInfo := Some(ScmInfo(
url("https://github.com/scala-js/scala-js-env-jsdom-nodejs"),
"scm:git:git@github.com:scala-js/scala-js-env-jsdom-nodejs.git",
Some("scm:git:git@github.com:scala-js/scala-js-env-jsdom-nodejs.git")))
))
val commonSettings = Def.settings(
// Scaladoc linking
apiURL := {
val name = moduleName.value
val v = version.value
Some(url(s"https://www.scala-js.org/api/$name/$v/"))
},
autoAPIMappings := true,
publishMavenStyle := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := (
<developers>
<developer>
<id>sjrd</id>
<name>Sébastien Doeraene</name>
<url>https://github.com/sjrd/</url>
</developer>
<developer>
<id>gzm0</id>
<name>Tobias Schlatter</name>
<url>https://github.com/gzm0/</url>
</developer>
<developer>
<id>nicolasstucki</id>
<name>Nicolas Stucki</name>
<url>https://github.com/nicolasstucki/</url>
</developer>
</developers>
),
pomIncludeRepository := { _ => false }
)
lazy val root: Project = project.in(file(".")).
settings(
publishArtifact in Compile := false,
publish := {},
publishLocal := {},
clean := clean.dependsOn(
clean in `scalajs-env-jsdom-nodejs`,
clean in `test-project`
).value
)
lazy val `scalajs-env-jsdom-nodejs`: Project = project.in(file("jsdom-nodejs-env")).
settings(
commonSettings,
libraryDependencies ++= Seq(
"org.scala-js" %% "scalajs-js-envs" % scalaJSVersion,
"org.scala-js" %% "scalajs-env-nodejs" % scalaJSVersion,
"com.novocode" % "junit-interface" % "0.11" % "test",
"org.scala-js" %% "scalajs-js-envs-test-kit" % scalaJSVersion % "test",
/* See JSDOMNodeJSEnvTest.reactUnhandledExceptionHack.
* We use intransitive() because we do not need the transitive
* dependencies of these webjars, and one of them actually fails to
* resolve (see https://github.com/webjars/webjars/issues/1789).
*/
"org.webjars.npm" % "react" % "16.13.1" % "test" intransitive(),
"org.webjars.npm" % "react-dom" % "16.13.1" % "test" intransitive(),
)
)
lazy val `test-project`: Project = project.
enablePlugins(ScalaJSPlugin).
enablePlugins(ScalaJSJUnitPlugin).
settings(
scalaJSUseMainModuleInitializer := true,
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv()
)