This repository has been archived by the owner on Feb 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sbt
125 lines (114 loc) · 4.13 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
import org.scalajs.linker.interface.ModuleSplitStyle
val reactJS = "17.0.2"
val reactSUI = "2.0.4"
val scalaJsReact = "2.1.1"
val scalaJSReactCommon = "0.17.0"
val cats = "2.8.0"
val munit = "0.7.29"
cancelable in Global := true
resolvers in Global += Resolver.sonatypeRepo("public")
ThisBuild / turbo := true
Global / onChangedBuildSource := ReloadOnSourceChanges
// sbt-release-early
inThisBuild(
List(
homepage := Some(url("https://github.com/cquiroz/scalajs-react-semantic-ui")),
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-semantic-ui"),
"scm:git:git@github.com:cquiroz/scalajs-react-semantic-ui.git"
)
)
)
)
val root =
project
.in(file("."))
.settings(commonSettings: _*)
.aggregate(facade, demo)
.settings(
name := "scalajs-react-semantic-ui",
// 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(ScalaJSPlugin)
.settings(commonSettings: _*)
.settings(
test := {},
Compile / fastLinkJS / scalaJSLinkerConfig ~= { _.withSourceMap(false) },
Compile / fullLinkJS / scalaJSLinkerConfig ~= { _.withSourceMap(false) },
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
Compile / fastLinkJS / scalaJSLinkerConfig ~= (_.withModuleSplitStyle(
ModuleSplitStyle.SmallestModules
)),
Compile / fullLinkJS / scalaJSLinkerConfig ~= (_.withModuleSplitStyle(
ModuleSplitStyle.FewestModules
)),
publish / skip := true,
publish := {},
publishLocal := {},
publishArtifact := false,
Keys.`package` := file("")
)
.dependsOn(facade)
lazy val facade =
project
.in(file("facade"))
.enablePlugins(ScalaJSBundlerPlugin)
.settings(commonSettings: _*)
.settings(
name := "react-semantic-ui",
webpack / version := "4.44.1",
startWebpackDevServer / version := "3.11.0",
installJsdom / version := "16.4.0",
// Requires the DOM for tests
Test / requireJsDomEnv := true,
// Compile tests to JS using fast-optimisation
Test / scalaJSStage := FastOptStage,
Compile / npmDependencies ++= Seq(
"react" -> reactJS,
"react-dom" -> reactJS,
"semantic-ui-react" -> reactSUI,
"chokidar" -> "3.4.2"
),
libraryDependencies ++= Seq(
"com.github.japgolly.scalajs-react" %%% "core" % scalaJsReact,
"com.github.japgolly.scalajs-react" %%% "extra" % scalaJsReact,
"com.github.japgolly.scalajs-react" %%% "test" % scalaJsReact % Test,
"io.github.cquiroz.react" %%% "common" % scalaJSReactCommon,
"org.scalameta" %%% "munit" % munit % Test,
"org.typelevel" %%% "cats-core" % cats % Test
),
Test / webpackConfigFile := Some(baseDirectory.value / "test.webpack.config.js"),
testFrameworks += new TestFramework("utest.runner.Framework"),
testFrameworks += new TestFramework("munit.Framework")
)
lazy val commonSettings = Seq(
scalaVersion := "2.13.10",
organization := "io.github.cquiroz.react",
sonatypeProfileName := "io.github.cquiroz",
description := "scala.js facade for react-semanticui",
Test / publishArtifact := false,
scalacOptions ~= (_.filterNot(
Set(
// By necessity facades will have unused params
"-Wdead-code",
"-Wunused:params",
"-Wunused:explicits"
)
))
)