1
- addCommandAlias(" restartWDS" , " ; demo/fastOptJS::stopWebpackDevServer; ~demo/fastOptJS::startWebpackDevServer" )
2
-
3
- lazy val root = project.in(file(" ." )).settings(commonSettings).aggregate(core, icons, lab, demo).settings(
4
- name := " scalajs-react-material-ui" ,
5
- skip in publish := true
6
- )
1
+ lazy val root = if (Settings .isDemoEnabled)
2
+ project.in(file(" ." )).aggregate(core, icons, lab, bridge, demo).configure(Settings .rootProject)
3
+ else
4
+ project.in(file(" ." )).aggregate(core, icons, lab, bridge).configure(Settings .rootProject)
7
5
8
6
inThisBuild(
9
7
List (
10
8
homepage := Some (url(" https://github.com/kinoplan/scalajs-react-material-ui" )),
11
9
licenses := Seq (" MIT" -> url(" http://opensource.org/licenses/MIT" )),
12
10
developers := List (
13
11
Developer (
14
- " kazievab " ,
15
- " Alexey Kaziev " ,
16
- " kazievab@gmail.com " ,
17
- url(" https://github.com/kazievab " )
12
+ " kinoplan " ,
13
+ " Kinoplan " ,
14
+ " job@kinoplan.ru " ,
15
+ url(" https://kinoplan.tech " )
18
16
)
19
17
),
20
18
scmInfo := Some (
@@ -28,53 +26,80 @@ inThisBuild(
28
26
29
27
lazy val muiColorsGenerator = taskKey[Seq [File ]](" mui-colors-generator" )
30
28
31
- lazy val core = (project in file(" core" )).settings(commonSettings).settings(
29
+ lazy val core = (project in file(" core" )).dependsOn(bridge)
30
+ .settings(commonSettings).settings(
32
31
name := " scalajs-react-material-ui-core" ,
33
- scalaJSUseMainModuleInitializer := false ,
32
+ scalaJSUseMainModuleInitializer := false ,
34
33
npmDependencies in Compile ++= Settings .npmDependenciesCore.value,
34
+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
35
35
libraryDependencies ++= Settings .scalajsDependenciesLib.value,
36
- muiColorsGenerator := Settings .generateColors (
36
+ muiColorsGenerator := Generator .muiColors (
37
37
(sourceManaged in Compile ).value / " io" / " kinoplan" / " scalajs" / " react" / " material" / " ui" / " core" / " colors" ,
38
38
(npmInstallDependencies in Compile ).value
39
39
),
40
- sourceGenerators in Compile += muiColorsGenerator.taskValue
40
+ sourceGenerators in Compile += muiColorsGenerator.taskValue,
41
+ sources in(Compile , doc) := Seq .empty,
42
+ publishArtifact in(Compile , packageDoc) := false ,
41
43
).enablePlugins(ScalaJSBundlerPlugin )
42
44
43
45
lazy val muiIconsGenerator = taskKey[Seq [File ]](" mui-icons-generator" )
44
46
45
- lazy val icons = (project in file(" icons" )).settings(commonSettings).settings(
47
+ lazy val icons = (project in file(" icons" )).dependsOn(bridge)
48
+ .settings(commonSettings).settings(
46
49
name := " scalajs-react-material-ui-icons" ,
47
- scalaJSUseMainModuleInitializer := false ,
50
+ scalaJSUseMainModuleInitializer := false ,
48
51
npmDependencies in Compile ++= Settings .npmDependenciesIcons.value,
52
+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
49
53
libraryDependencies ++= Settings .scalajsDependenciesLib.value,
50
- muiIconsGenerator := Settings .generateIcons (
54
+ muiIconsGenerator := Generator .muiIcons (
51
55
(sourceManaged in Compile ).value / " io" / " kinoplan" / " scalajs" / " react" / " material" / " ui" / " icons" ,
52
56
(npmInstallDependencies in Compile ).value
53
57
),
54
- sourceGenerators in Compile += muiIconsGenerator.taskValue
58
+ sourceGenerators in Compile += muiIconsGenerator.taskValue,
59
+ sources in(Compile , doc) := Seq .empty,
60
+ publishArtifact in(Compile , packageDoc) := false ,
55
61
).enablePlugins(ScalaJSBundlerPlugin )
56
62
57
- lazy val lab = (project in file(" lab" )).settings(commonSettings).settings(
63
+ lazy val lab = (project in file(" lab" )).dependsOn(bridge)
64
+ .settings(commonSettings).settings(
58
65
name := " scalajs-react-material-ui-lab" ,
59
- scalaJSUseMainModuleInitializer := false ,
66
+ scalaJSUseMainModuleInitializer := false ,
60
67
npmDependencies in Compile ++= Settings .npmDependenciesLab.value,
61
- libraryDependencies ++= Settings .scalajsDependenciesLib.value
68
+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
69
+ libraryDependencies ++= Settings .scalajsDependenciesLib.value,
70
+ sources in(Compile , doc) := Seq .empty,
71
+ publishArtifact in(Compile , packageDoc) := false ,
62
72
).enablePlugins(ScalaJSBundlerPlugin )
63
73
64
- lazy val demo = (project in file(" demo" )).dependsOn(core, lab)
74
+ lazy val demo = (project in file(" demo" )).dependsOn(core, lab, bridge )
65
75
.settings(commonSettings).settings(
66
- scalaJSUseMainModuleInitializer := true ,
76
+ scalaJSUseMainModuleInitializer := true ,
77
+ scalaJSLinkerConfig ~= (_.withSourceMap(false )),
78
+ stUseScalaJsDom := false ,
79
+ stFlavour := Flavour .Japgolly ,
80
+ stIgnore ++= Settings .stIgnore,
81
+ stOutputPackage := " io.kinoplan.scalajs.react.libs.external" ,
67
82
npmDependencies in Compile ++= Settings .npmDependenciesDemo.value,
83
+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
68
84
libraryDependencies ++= Settings .scalajsDependenciesDemo.value,
69
- webpackDevServerExtraArgs := Seq (" --inline" ),
70
- yarnExtraArgs := Seq (" --silent" ),
71
- webpackConfigFile in fastOptJS := Some (baseDirectory.value / " dev.webpack.config.js" ),
85
+ webpackDevServerExtraArgs := Seq (" --inline" ),
86
+ yarnExtraArgs := Seq (" --silent" ),
87
+ webpackConfigFile in fastOptJS := Some (baseDirectory.value / " dev.webpack.config.js" ),
72
88
skip in publish := true
73
- ).enablePlugins(ScalaJSBundlerPlugin )
89
+ ).enablePlugins(ScalaJSBundlerPlugin , ScalablyTypedConverterPlugin )
90
+
91
+ lazy val bridge = (project in file(" utils/bridge" )).settings(commonSettings).settings(
92
+ name := " scalajs-react-bridge" ,
93
+ scalaJSUseMainModuleInitializer := false ,
94
+ npmDependencies in Compile ++= Settings .npmDependenciesBridge.value,
95
+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
96
+ libraryDependencies ++= Settings .scalajsDependenciesBridge.value
97
+ ).enablePlugins(ScalaJSBundlerPlugin , BridgeGeneratorPlugin )
74
98
75
99
lazy val commonSettings = Seq (
76
100
version := Settings .version,
77
- scalaVersion := Settings .versions.scala,
101
+ crossScalaVersions := Seq (" 2.12.11" , " 2.13.3" ),
102
+ scalaVersion := crossScalaVersions.value.last,
78
103
organization := Settings .organization,
79
104
description := Settings .description,
80
105
homepage := Some (url(" https://github.com/kinoplan/scalajs-react-material-ui" )),
@@ -85,7 +110,23 @@ lazy val commonSettings = Seq(
85
110
version in webpack := Settings .versions.bundler.webpack,
86
111
version in startWebpackDevServer := Settings .versions.bundler.webpackDev,
87
112
webpackCliVersion := Settings .versions.bundler.webpackCli,
88
- emitSourceMaps := false ,
89
113
javacOptions ++= Settings .javacOptions,
90
- scalacOptions in ThisBuild ++= Settings .scalacOptions
114
+ scalacOptions ++= Settings .scalacOptions,
115
+ scalacOptions ~= (_.filterNot(
116
+ Set (
117
+ " -Wdead-code" ,
118
+ " -Wunused:params" ,
119
+ " -Ywarn-dead-code" ,
120
+ " -Ywarn-unused:params" ,
121
+ " -Ywarn-unused:patvars" ,
122
+ " -Wunused:explicits"
123
+ )
124
+ ))
91
125
)
126
+
127
+ onLoad in Global := (
128
+ " project bridge" ::
129
+ " bridgeImplicitsGenerator" ::
130
+ " project root" ::
131
+ (_ : State )
132
+ ) compose (onLoad in Global ).value
0 commit comments