forked from bot4s/telegram
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt.bak
257 lines (220 loc) · 8.42 KB
/
build.sbt.bak
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
// shadow sbt-scalajs' crossProject and CrossType from Scala.js 0.6.x
import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}
import PgpKeys.publishSigned
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport.npmDependencies
enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSBundlerPlugin)
scalaJSUseMainModuleInitializer := true
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val Version = new {
val akkaVersion = "2.5.13"
val akkaActor = akkaVersion
val akkaHttp = "10.1.3"
val akkaHttpCors = "0.3.0"
val akkaStream = akkaVersion
val cats = "1.1.0"
val circe = "0.9.3"
val logback = "1.2.3"
val scalajHttp = "2.4.0"
val scalaLogging = "3.8.0"
val scalaMock = "4.1.0"
val scalaMockscalaTest = "3.6.0"
val scalaTest = "3.0.5"
val slogging = "0.6.1"
val sttp = "1.2.0"
val hammock = "0.8.4"
}
lazy val root =
project
.enablePlugins(ScalaJSPlugin)
.in(file("."))
.settings(doNotPublish: _*)
.aggregate(
rootJVM,
rootJS
)
lazy val rootJS =
project
.in(file(".js"))
.settings(doNotPublish: _*)
.aggregate(
coreJS
)
lazy val rootJVM =
project
.in(file(".jvm"))
.settings(doNotPublish: _*)
.aggregate(
coreJVM,
examplesJVM,
akka
)
npmDependencies in(Compile, run) += "node-fetch" -> "2.1.2"
npmDependencies in(Compile, run) += "abortcontroller-polyfill" -> "1.1.9"
lazy val core =
crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.withoutSuffixFor(JVMPlatform)
.in(file("core"))
.settings(commonSettings)
.settings(
mainClass in(Compile, run) := Some("info.mukel.telegrambot4s.Main")
)
//.settings(doNotPublish)
.settings(
name := "telegrambot4s-core",
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % Version.circe,
"io.circe" %%% "circe-generic" % Version.circe,
"io.circe" %%% "circe-generic-extras" % Version.circe,
"io.circe" %%% "circe-parser" % Version.circe,
"io.circe" %%% "circe-literal" % Version.circe,
"org.typelevel" %%% "cats-core" % Version.cats,
"org.typelevel" %%% "cats-free" % Version.cats,
"com.softwaremill.sttp" %%% "core" % Version.sttp,
"com.pepegar" %%% "hammock-core" % Version.hammock,
"org.scalamock" %%% "scalamock-scalatest-support" % Version.scalaMockscalaTest % Test,
"org.scalatest" %%% "scalatest" % Version.scalaTest % Test,
"biz.enef" %%% "slogging" % Version.slogging
)
)
.jsSettings(
scalaJSModuleKind := ModuleKind.CommonJSModule, // <- enable commonjs module system
scalaJSUseMainModuleInitializer := true, // <- use main function `def main(args: Array[String]): Unit`
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.5",
"io.scalajs.npm" %%% "node-fetch" % "0.4.2"
),
npmDependencies in Compile ++= Seq("node-fetch" -> "2.1.2", "abortcontroller-polyfill" -> "1.1.9")
)
.jvmSettings(
libraryDependencies ++= Seq(
library.sttpOkHttp
)
)
lazy val coreJS = core.js.enablePlugins(ScalaJSBundlerPlugin)
lazy val coreJVM = core.jvm
lazy val akka: Project =
project
.in(file("akka"))
.settings(commonSettings: _*)
.settings(name := "telegrambot4s-akka")
.settings(
libraryDependencies ++= Seq(
library.akkaHttp,
library.akkaActor,
library.akkaStream,
library.akkaHttpCors
)
)
.aggregate(
coreJVM
)
lazy val examples =
crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.withoutSuffixFor(JVMPlatform)
.in(file("examples"))
.settings(commonSettings)
.settings(doNotPublish)
.settings(name := "examples")
.jsSettings()
.jvmSettings(
libraryDependencies ++= Seq(
library.akkaHttpCors
)
)
.dependsOn(core)
lazy val examplesJS = examples.js
lazy val examplesJVM = examples.jvm
// *****************************************************************************
// Library dependencies
// *****************************************************************************
lazy val library =
new {
val akkaHttp = "com.typesafe.akka" %% "akka-http" % Version.akkaHttp
val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % Version.akkaHttp
val akkaActor = "com.typesafe.akka" %% "akka-actor" % Version.akkaActor
val akkaStream = "com.typesafe.akka" %% "akka-stream" % Version.akkaStream
// val json4sCore = "org.json4s" %% "json4s-core" % Version.json4s
// val json4sJackson = "org.json4s" %% "json4s-jackson" % Version.json4s
// val json4sNative = "org.json4s" %% "json4s-native" % Version.json4s
// val json4sExt = "org.json4s" %% "json4s-ext" % Version.json4s
val scalajHttp = "org.scalaj" %% "scalaj-http" % Version.scalajHttp
val scalaMock = "org.scalamock" %% "scalamock-scalatest-support" % Version.scalaMock
val akkaHttpCors = "ch.megard" %% "akka-http-cors" % Version.akkaHttpCors
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
//val slogging = "biz.enef" %%% "slogging" % Version.slogging
val logback = "ch.qos.logback" % "logback-classic" % Version.logback
val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % Version.scalaLogging
//val circeCore = "io.circe" %%% "circe-core" % Version.circe
//val circeGeneric = "io.circe" %%% "circe-generic" % Version.circe
//val circeParser = "io.circe" %%% "circe-parser" % Version.circe
//val circeGenericExtras = "io.circe" %%% "circe-generic-extras" % Version.circe
//val circeLiteral = "io.circe" %%% "circe-literal" % Version.circe
//val catsCore = "org.typelevel" %%% "cats-core" % Version.cats
//val catsFree = "org.typelevel" %%% "cats-free" % Version.cats
//val rosHttp = "fr.hmil" %%% "roshttp" % Version.rosHttp
//val sttpCore = "com.softwaremill.sttp" %%% "core" % Version.sttp
val sttpOkHttp = "com.softwaremill.sttp" %% "okhttp-backend" % Version.sttp
//val sttpCirce = "com.softwaremill.sttp" %%% "circe" % Version.sttp
}
// *****************************************************************************
// Settings
// *****************************************************************************
lazy val commonSettings =
Seq(
organization := "info.mukel",
organizationName := "Alfonso² Peterssen",
scalaVersion := "2.12.6",
crossScalaVersions := Seq(scalaVersion.value, "2.11.11"),
startYear := Some(2015),
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
//"-Xfatal-warnings",
"-Xlint:_",
"-Yno-adapted-args",
"-Ywarn-dead-code"
),
shellPrompt in ThisBuild := { state =>
val project = Project.extract(state).currentRef.project
s"[$project]> "
}
)
lazy val publishSettings =
Seq(
homepage := Some(url("https://github.com/mukel/telegrambot4s")),
scmInfo := Some(ScmInfo(url("https://github.com/mukel/telegrambot4s"),
"[email protected]:mukel/telegrambot4s.git")),
developers += Developer("mukel",
"Alfonso² Peterssen",
url("https://github.com/mukel")),
pomIncludeRepository := (_ => false),
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
),
publishArtifact in Test := false,
publishMavenStyle := true,
// sbt-release
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseIgnoreUntrackedFiles := true,
releaseProcess := TelegramBot4sRelease.steps
)
lazy val doNotPublish =
Seq(
publishArtifact := false,
skip in publish := true
)