This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
124 lines (115 loc) · 4.2 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
115
116
117
118
119
120
121
122
123
124
import Settings.LibraryVersions
addCommandAlias("restartWDS",
"; demo/fastOptJS::stopWebpackDevServer; demo/fastOptJS::startWebpackDevServer"
)
addCommandAlias("restartWDS",
"; demo/fastOptJS::stopWebpackDevServer; demo/fastOptJS::startWebpackDevServer"
)
// resolvers in Global += Resolver.sonatypeRepo("staging")
Global / onChangedBuildSource := ReloadOnSourceChanges
Global / resolvers += Resolver.sonatypeRepo("public")
inThisBuild(
List(
homepage := Some(url("https://github.com/cquiroz/scalajs-react-virtualized")),
licenses := Seq("BSD 3-Clause License" -> url("https://opensource.org/licenses/BSD-3-Clause")),
developers := List(
Developer("cquiroz",
"Carlos Quiroz",
"carlos.m.quiroz@gmail.com",
url("https://github.com/cquiroz")
)
),
scmInfo := Some(
ScmInfo(url("https://github.com/cquiroz/scalajs-react-virtualized"),
"scm:git:git@github.com:cquiroz/scalajs-react-virtualized.git"
)
)
)
)
val root =
project
.in(file("."))
.settings(commonSettings: _*)
.aggregate(facade, demo)
.settings(
name := "root",
// No, SBT, we don't want any artifacts for root.
// No, not even an empty jar.
publish := {},
publishLocal := {},
publishArtifact := false,
Keys.`package` := file("")
)
lazy val demo =
project
.in(file("demo"))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(commonSettings: _*)
.settings(
scalaJSUseMainModuleInitializer := true,
webpackBundlingMode := BundlingMode.LibraryOnly(),
webpackDevServerExtraArgs := Seq("--inline"),
fastOptJS / webpackConfigFile := Some(baseDirectory.value / "dev.webpack.config.js"),
webpack / version := "4.30.0",
webpackCliVersion / version := "3.3.2",
startWebpackDevServer / version := "3.3.1",
// don't publish the demo
publish := {},
publishLocal := {},
publishArtifact := false,
Keys.`package` := file("")
)
.dependsOn(facade)
lazy val facade =
project
.in(file("facade"))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(commonSettings: _*)
.settings(
name := "react-virtualized",
Compile / npmDependencies ++= Seq(
"react" -> LibraryVersions.reactJS,
"react-dom" -> LibraryVersions.reactJS,
"react-virtualized" -> LibraryVersions.reactVirtualized
),
// Requires the DOM for tests
Test / requireJsDomEnv := true,
// Use yarn as it is faster than npm
useYarn := true,
webpack / version := "4.44.1",
webpackCliVersion / version := "3.3.11",
startWebpackDevServer / version := "3.11.0",
scalaJSUseMainModuleInitializer := false,
// Compile tests to JS using fast-optimisation
Test / scalaJSStage := FastOptStage,
libraryDependencies ++= Seq(
"com.github.japgolly.scalajs-react" %%% "core" % LibraryVersions.scalaJsReact,
"com.github.japgolly.scalajs-react" %%% "test" % LibraryVersions.scalaJsReact % "test",
"io.github.cquiroz.react" %%% "common" % LibraryVersions.react,
"io.github.cquiroz.react" %%% "test" % LibraryVersions.react % Test,
"io.github.cquiroz.react" %%% "cats" % LibraryVersions.react,
"org.scalameta" %%% "munit" % LibraryVersions.munit % Test,
"org.typelevel" %%% "cats-core" % LibraryVersions.cats % Test
),
Test / webpackConfigFile := Some(baseDirectory.value / "test.webpack.config.js"),
testFrameworks += new TestFramework("munit.Framework")
)
lazy val commonSettings = Seq(
scalaVersion := "2.13.7",
organization := "io.github.cquiroz.react",
sonatypeProfileName := "io.github.cquiroz",
description := "scala.js facade for react-virtualized",
homepage := Some(url("https://github.com/cquiroz/scalajs-react-virtualized")),
licenses := Seq("BSD 3-Clause License" -> url("https://opensource.org/licenses/BSD-3-Clause")),
Test / publishArtifact := false,
scalacOptions ~= (_.filterNot(
Set(
// By necessity facades will have unused params
"-Wdead-code",
"-Wunused:params",
"-Ywarn-dead-code",
"-Ywarn-unused:params",
"-Wunused:explicits"
)
))
)