forked from UdashFramework/udash-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
174 lines (151 loc) · 6.11 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
import Dependencies._
import UdashBuild._
name := "udash"
version in ThisBuild := "0.5.0-SNAPSHOT"
scalaVersion in ThisBuild := versionOfScala
crossScalaVersions in ThisBuild := Seq("2.11.8", "2.12.1")
organization in ThisBuild := "io.udash"
cancelable in Global := true
scalacOptions in ThisBuild ++= Seq(
"-feature",
"-deprecation",
"-unchecked",
"-language:implicitConversions",
"-language:existentials",
"-language:dynamics",
"-language:experimental.macros",
"-Xfuture",
"-Xfatal-warnings",
"-Xlint:_,-missing-interpolator,-adapted-args"
)
jsTestEnv in ThisBuild := new org.scalajs.jsenv.selenium.SeleniumJSEnv(org.scalajs.jsenv.selenium.Firefox())
val commonSettings = Seq(
moduleName := "udash-" + moduleName.value,
libraryDependencies ++= compilerPlugins.value,
libraryDependencies ++= commonDeps.value,
libraryDependencies ++= commonTestDeps.value
)
val commonJSSettings = Seq(
emitSourceMaps in Compile := true,
scalaJSStage in Test := FastOptStage,
jsDependencies in Test += RuntimeDOM % Test,
jsEnv in Test := jsTestEnv.value,
scalacOptions += {
val localDir = (baseDirectory in ThisBuild).value.toURI.toString
val githubDir = "https://raw.githubusercontent.com/UdashFramework/udash-core"
s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/"
}
)
lazy val udash = project.in(file("."))
.aggregate(
`core-macros`, `core-shared-JS`, `core-shared-JVM`, `core-frontend`,
`rpc-macros`, `rpc-shared-JS`, `rpc-shared-JVM`, `rpc-frontend`, `rpc-backend`,
`rest-macros`, `rest-shared-JS`, `rest-shared-JVM`,
`i18n-shared-JS`, `i18n-shared-JVM`, `i18n-frontend`, `i18n-backend`,
`bootstrap`
)
.settings(publishArtifact := false)
lazy val `core-macros` = project.in(file("core/macros"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
)
lazy val `core-shared` = crossProject.crossType(CrossType.Pure).in(file("core/shared"))
.jsConfigure(_.dependsOn(`core-macros`))
.jvmConfigure(_.dependsOn(`core-macros`))
.settings(commonSettings: _*).settings(
libraryDependencies ++= coreCrossDeps.value
)
.jsSettings(commonJSSettings:_*)
lazy val `core-shared-JVM` = `core-shared`.jvm
lazy val `core-shared-JS` = `core-shared`.js
lazy val `core-frontend` = project.in(file("core/frontend")).enablePlugins(ScalaJSPlugin)
.dependsOn(`core-shared-JS` % CompileAndTest)
.settings(commonSettings: _*)
.settings(commonJSSettings: _*)
.settings(
emitSourceMaps in Compile := true,
libraryDependencies ++= coreFrontendDeps.value,
publishedJS := Def.taskDyn {
if (isSnapshot.value) Def.task((fastOptJS in Compile).value) else Def.task((fullOptJS in Compile).value)
}.value,
publishedJSDependencies := Def.taskDyn {
if (isSnapshot.value) Def.task((packageJSDependencies in Compile).value) else Def.task((packageMinifiedJSDependencies in Compile).value)
}.value
)
lazy val `rpc-macros` = project.in(file("rpc/macros"))
.dependsOn(`core-macros`)
.settings(commonSettings: _*).settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"com.avsystem.commons" %% "commons-macros" % avsCommonsVersion
)
)
lazy val `rpc-shared` = crossProject.crossType(CrossType.Full).in(file("rpc/shared"))
.configureCross(_.dependsOn(`core-shared` % CompileAndTest))
.jsConfigure(_.dependsOn(`rpc-macros`))
.jvmConfigure(_.dependsOn(`rpc-macros`))
.settings(commonSettings: _*).settings(
libraryDependencies ++= rpcCrossDeps.value,
libraryDependencies ++= rpcCrossTestDeps.value
)
.jsSettings(commonJSSettings:_*)
.jvmSettings(
libraryDependencies ++= rpcSharedJVMDeps.value
)
lazy val `rpc-shared-JVM` = `rpc-shared`.jvm
lazy val `rpc-shared-JS` = `rpc-shared`.js
lazy val `rpc-backend` = project.in(file("rpc/backend"))
.dependsOn(`rpc-shared-JVM` % CompileAndTest)
.settings(commonSettings: _*).settings(
libraryDependencies ++= rpcBackendDeps.value
)
lazy val `rpc-frontend` = project.in(file("rpc/frontend")).enablePlugins(ScalaJSPlugin)
.dependsOn(`rpc-shared-JS` % CompileAndTest, `core-frontend` % CompileAndTest)
.settings(commonSettings: _*)
.settings(commonJSSettings: _*)
.settings(
jsDependencies ++= rpcFrontendJsDeps.value
)
lazy val `rest-macros` = project.in(file("rest/macros"))
.dependsOn(`rpc-macros`)
.settings(commonSettings: _*).settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"com.avsystem.commons" %% "commons-macros" % avsCommonsVersion
)
)
lazy val `rest-shared` = crossProject.crossType(CrossType.Pure).in(file("rest/shared"))
.configureCross(_.dependsOn(`rpc-shared` % CompileAndTest))
.jsConfigure(_.dependsOn(`rest-macros`))
.jvmConfigure(_.dependsOn(`rest-macros`))
.settings(commonSettings: _*).settings(
libraryDependencies ++= restCrossDeps.value
)
.jsSettings(commonJSSettings:_*)
lazy val `rest-shared-JVM` = `rest-shared`.jvm
lazy val `rest-shared-JS` = `rest-shared`.js
lazy val `i18n-shared` = crossProject.crossType(CrossType.Pure).in(file("i18n/shared"))
.configureCross(_.dependsOn(`core-shared`, `rpc-shared` % CompileAndTest))
.settings(commonSettings: _*)
.jsSettings(commonJSSettings:_*)
lazy val `i18n-shared-JVM` = `i18n-shared`.jvm
lazy val `i18n-shared-JS` = `i18n-shared`.js
lazy val `i18n-backend` = project.in(file("i18n/backend"))
.dependsOn(`i18n-shared-JVM` % CompileAndTest, `rpc-backend` % CompileAndTest)
.settings(commonSettings: _*)
lazy val `i18n-frontend` = project.in(file("i18n/frontend")).enablePlugins(ScalaJSPlugin)
.dependsOn(`i18n-shared-JS` % CompileAndTest, `core-frontend` % CompileAndTest)
.settings(commonSettings: _*)
.settings(commonJSSettings: _*)
.settings(
jsDependencies += RuntimeDOM % Test
)
lazy val `bootstrap` = project.in(file("bootstrap/frontend")).enablePlugins(ScalaJSPlugin)
.dependsOn(`core-frontend` % CompileAndTest)
.settings(commonSettings: _*)
.settings(commonJSSettings: _*)
.settings(
libraryDependencies ++= bootstrapFrontendDeps.value,
jsDependencies ++= bootstrapFrontendJsDeps.value
)