-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
131 lines (115 loc) · 3.77 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
import sbt.Keys.credentials
lazy val root = project.in(file(".")).aggregate(server)
lazy val protocol = crossProject(JSPlatform, JVMPlatform).crossType(CrossType.Pure)
.settings(commonSettings ++ publishSettings)
.settings(
description := "Bittorrent server protocol",
libraryDependencies ++= List(
Deps.bittorrent.common.value,
Deps.upickle.value,
Deps.`scodec-bits`.value,
)
)
lazy val server = project
.dependsOn(protocol.jvm)
.settings(commonSettings)
.settings(
libraryDependencies ++= List(
Deps.bittorrent.bittorrent,
Deps.bittorrent.tracker,
Deps.`cats-effect`,
Deps.`fs2-io`,
Deps.http4s.core,
Deps.http4s.dsl,
Deps.http4s.server,
Deps.http4s.client,
Deps.`woof-core`,
Deps.`woof-slf4j`,
Deps.requests,
),
)
.enablePlugins(JavaAppPackaging)
lazy val commonSettings: List[Setting[_]] = List(
organization := "io.github.torrentdam.server",
version := sys.env.getOrElse("VERSION", "SNAPSHOT"),
scalaVersion := "3.2.1",
scalacOptions ++= List(
"-source:future",
"-Ykind-projector:underscores",
),
libraryDependencies ++= List(
Deps.`cps-async-cats-effect`,
Deps.`munit-cats-effect` % Test
)
)
lazy val publishSettings: List[Setting[_]] = List(
publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
credentials ++= {
sys.env.get("SONATYPE_CREDS") match {
case Some(credentials) =>
val Array(username, password) = credentials.split(':')
List(
Credentials(
"Sonatype Nexus Repository Manager",
"s01.oss.sonatype.org",
username,
password
)
)
case None => List.empty[Credentials]
}
},
developers := List(
Developer(
id = "lavrov",
name = "Vitaly Lavrov",
email = "lavrovvv@gmail.com",
url = url("https://github.com/lavrov")
)
),
scmInfo := Some(
ScmInfo(
url("https://github.com/TorrentDam/server"),
"scm:git@github.com:TorrentDam/server.git"
)
),
licenses := List("Unlicense" -> new URL("https://unlicense.org/")),
homepage := Some(url("https://torrentdam.github.io/"))
)
lazy val Deps = new {
val bittorrent = new {
private val org = "io.github.torrentdam.bittorrent"
val common = Def.setting { org %%% "common" % Versions.bittorrent }
val bittorrent = org %% "bittorrent" % Versions.bittorrent
val tracker = org %% "tracker" % Versions.bittorrent
}
val `scodec-bits` = Def.setting {"org.scodec" %%% "scodec-bits" % Versions.`scodec-bits` }
val `cats-effect` = "org.typelevel" %% "cats-effect" % Versions.`cats-effect`
val `fs2-io` = "co.fs2" %% "fs2-io" % Versions.fs2
val http4s = new {
val core = "org.http4s" %% "http4s-core" % Versions.http4s
val dsl = "org.http4s" %% "http4s-dsl" % Versions.http4s
val server = "org.http4s" %% "http4s-ember-server" % Versions.http4s
val client = "org.http4s" %% "http4s-ember-client" % Versions.http4s
}
val requests = "com.lihaoyi" %% "requests" % Versions.requests
val `woof-core` = "org.legogroup" %% "woof-core" % Versions.woof
val `woof-slf4j` = "org.legogroup" %% "woof-slf4j" % Versions.woof
val upickle = Def.setting {"com.lihaoyi" %%% "upickle" % Versions.upickle }
val `munit-cats-effect` = "org.typelevel" %% "munit-cats-effect-3" % "1.0.5"
val `cps-async-cats-effect` = "com.github.rssh" %% "cps-async-connect-cats-effect" % Versions.`cps-async`
}
lazy val Versions = new {
val bittorrent = "1.8.3"
val `cats-effect` = "3.3.12"
val fs2 = "3.2.8"
val `scodec-bits` = "1.1.27"
val upickle = "1.4.0"
val http4s = "1.0.0-M37"
val requests = "0.6.9"
val `cps-async` = "0.9.9"
val woof = "0.4.5"
}