This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
191 lines (179 loc) · 5.85 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name := "scalajs-react-beautiful-dnd"
Global / onChangedBuildSource := ReloadOnSourceChanges
val reactJS = "17.0.2"
val reactBeautiulDnD = "13.1.0"
val atlasKitTree = "8.4.0"
val scalaJsReact = "2.1.1"
val cats = "2.8.0" // Only used in demo
addCommandAlias(
"restartDemoWDS",
"; demo/fastOptJS/stopWebpackDevServer; demo/fastOptJS/startWebpackDevServer"
)
addCommandAlias(
"restartTreeDemoWDS",
"; treeDemo/fastOptJS/stopWebpackDevServer; treeDemo/fastOptJS/startWebpackDevServer"
)
inThisBuild(
List(
scalaVersion := "2.13.8",
Test / parallelExecution := false,
organization := "com.rpiaggio",
sonatypeProfileName := "com.rpiaggio",
homepage := Some(
url("https://github.com/rpiaggio/scalajs-react-beautiful-dnd")
),
licenses := Seq(
"BSD 3-Clause License" -> url(
"https://opensource.org/licenses/BSD-3-Clause"
)
),
developers := List(
Developer(
"rpiaggio",
"Raúl Piaggio",
url("https://github.com/rpiaggio")
),
Developer(
"cquiroz",
"Carlos Quiroz",
url("https://github.com/cquiroz")
)
),
scmInfo := Some(
ScmInfo(
url("https://github.com/rpiaggio/scalajs-react-beautiful-dnd"),
"scm:git:[email protected]:rpiaggio/scalajs-react-beautiful-dnd.git"
)
)
)
)
lazy val commonSettings = Seq(
description := "scala.js facade for react-beautiful-dnd",
Test / publishArtifact := false,
publishMavenStyle := true,
scalacOptions ~= (_.filterNot(
Set(
// By necessity facades will have unused params
"-Wdead-code",
"-Wunused:params",
"-Wunused:explicits",
"-Wunused:imports"
)
))
)
val root =
project
.in(file("."))
.settings(commonSettings: _*)
.aggregate(facade, demo, treeFacade, treeDemo)
.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 facade =
project
.in(file("facade"))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(commonSettings: _*)
.settings(
name := "facade",
moduleName := "scalajs-react-beautiful-dnd",
Compile / npmDependencies ++= Seq(
"react" -> reactJS,
"react-dom" -> reactJS,
"react-beautiful-dnd" -> reactBeautiulDnD
),
// Use yarn as it is faster than npm
useYarn := true,
webpack / version := "4.30.0",
startWebpackDevServer / version := "3.3.1",
scalaJSUseMainModuleInitializer := false,
libraryDependencies ++= Seq(
"com.github.japgolly.scalajs-react" %%% "core" % scalaJsReact
)
)
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"
),
useYarn := true,
webpack / version := "4.30.0",
startWebpackDevServer / version := "3.3.1",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % cats
),
// don't publish the demo
publish := {},
publishLocal := {},
publishArtifact := false,
Keys.`package` := file(""),
Compile / npmDevDependencies ++= Seq(
"css-loader" -> "1.0.0",
"style-loader" -> "0.23.0"
)
)
.dependsOn(facade)
lazy val treeFacade =
project
.in(file("tree-facade"))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(commonSettings: _*)
.settings(
name := "tree-facade",
moduleName := "scalajs-react-atlaskit-tree",
Compile / npmDependencies ++= Seq(
"@atlaskit/tree" -> atlasKitTree
),
// Use yarn as it is faster than npm
useYarn := true,
webpack / version := "4.30.0",
startWebpackDevServer / version := "3.3.1",
scalaJSUseMainModuleInitializer := false
)
.dependsOn(facade)
lazy val treeDemo =
project
.in(file("tree-demo"))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(commonSettings: _*)
.settings(
scalaJSUseMainModuleInitializer := true,
webpackBundlingMode := BundlingMode.LibraryOnly(),
webpackDevServerExtraArgs := Seq("--inline"),
fastOptJS / webpackConfigFile := Some(
baseDirectory.value / "dev.webpack.config.js"
),
useYarn := true,
webpack / version := "4.30.0",
startWebpackDevServer / version := "3.3.1",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % cats
),
// don't publish the demo
publish := {},
publishLocal := {},
publishArtifact := false,
Keys.`package` := file(""),
Compile / npmDevDependencies ++= Seq(
"css-loader" -> "1.0.0",
"style-loader" -> "0.23.0"
),
Compile / fastOptJS / scalaJSLinkerConfig ~= { _.withSourceMap(false) },
Compile / fullOptJS / scalaJSLinkerConfig ~= { _.withSourceMap(false) }
)
.dependsOn(treeFacade)