-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sbt
More file actions
150 lines (135 loc) · 4.01 KB
/
build.sbt
File metadata and controls
150 lines (135 loc) · 4.01 KB
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
val scalaVer = "2.12.3"
cancelable in Global := true
val projectName = "scala-js-preact"
scalaVersion := scalaVer
val publishSettings = Seq(
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")
},
pomIncludeRepository := { _ => false },
publishArtifact := true,
publishArtifact in Test := false,
licenses := Seq("MIT License" -> url("https://opensource.org/licenses/mit-license.php")),
homepage := Some(url("https://github.com/lmnet/scala-js-preact")),
pomExtra := {
<scm>
<url>git@github.com:lmnet/scala-js-preact.git</url>
<connection>scm:git:git@github.com:lmnet/scala-js-preact.git</connection>
</scm>
<developers>
<developer>
<id>lmnet</id>
<name>Yuriy Badalyantc</name>
<email>lmnet89@gmail.com</email>
</developer>
</developers>
}
)
val commonSettings = Seq(
organization := "com.github.lmnet",
scalaVersion := scalaVer,
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-language:implicitConversions",
"-language:postfixOps",
"-Ywarn-unused",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-Xlint:missing-interpolator",
"-P:scalajs:sjsDefinedByDefault"
),
jsEnv in Test := PhantomJSEnv().value,
publishArtifact := false
)
val withMacroParadise = Seq(
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M10" cross CrossVersion.full)
)
val lodashJsTestDep = "org.webjars.npm" % "lodash" % "4.17.3" / s"4.17.3/lodash.js" % "test"
val scalajsDomDep = Def.setting("org.scala-js" %%% "scalajs-dom" % "0.9.1")
val scalatestTestDep = Def.setting("org.scalatest" %%% "scalatest" % "3.0.1" % "test")
lazy val raw = project
.enablePlugins(ScalaJSPlugin)
.settings(
commonSettings,
publishSettings,
name := s"$projectName-raw",
scalacOptions -= "-Ywarn-unused",
libraryDependencies ++= Seq(
scalajsDomDep.value,
scalatestTestDep.value
),
jsDependencies ++= Seq(
"org.webjars.npm" % "preact" % "8.2.5" / "dist/preact.min.js",
lodashJsTestDep
)
)
lazy val core = project
.enablePlugins(ScalaJSPlugin)
.dependsOn(raw % "compile->compile;test->test")
.aggregate(raw)
.settings(
commonSettings,
publishSettings,
name := s"$projectName-core",
resolvers += Resolver.bintrayIvyRepo("scalameta", "maven"),
addCompilerPlugin("com.github.ghik" %% "silencer-plugin" % "0.5"),
scalacOptions += "-Xplugin-require:macroparadise",
withMacroParadise,
libraryDependencies ++= Seq(
"com.github.ghik" %% "silencer-lib" % "0.5",
"org.scalameta" %%% "scalameta" % "1.8.0"
)
)
lazy val symbolDsl = project.in(file("./dsl/symbol"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(core)
.settings(
commonSettings,
publishSettings,
name := s"$projectName-dsl-symbol",
libraryDependencies ++= Seq(
scalatestTestDep.value
),
jsDependencies ++= Seq(
lodashJsTestDep
)
)
lazy val tagsDsl = project.in(file("./dsl/tags"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(core)
.settings(
commonSettings,
publishSettings,
name := s"$projectName-dsl-tags",
libraryDependencies ++= Seq(
scalatestTestDep.value
),
jsDependencies ++= Seq(
lodashJsTestDep
)
)
lazy val basicExample = project.in(file("./examples/basic"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(symbolDsl)
.settings(
commonSettings,
withMacroParadise
)
lazy val todomvcExample = project.in(file("./examples/todomvc"))
.enablePlugins(ScalaJSPlugin)
.dependsOn(symbolDsl)
.settings(
commonSettings,
libraryDependencies += "com.github.fomkin" %%% "pushka-json" % "0.8.0",
withMacroParadise
)
lazy val examples = project
.aggregate(basicExample, todomvcExample)
lazy val root = project.in(file("."))
.aggregate(core, symbolDsl, tagsDsl, examples)