-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.sbt
184 lines (153 loc) · 5.36 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
175
176
177
178
179
180
181
182
183
184
val Organization = "be.wegenenverkeer"
val Version = "2.1-SNAPSHOT"
val ScalaVersion = "2.13.0"
val ScalaBuildOptions = Seq("-unchecked",
"-deprecation",
"-feature",
"-language:reflectiveCalls",
"-language:implicitConversions",
"-language:postfixOps",
"-language:higherKinds",
"-target:jvm-1.8")
val asyncClient = "org.asynchttpclient" % "async-http-client" % "2.12.1"
val rxStreamsVersion = "1.0.3"
val rxJavaVersion = "3.1.5"
val reactorVersion = "3.4.9"
val fs2Version = "2.2.2"
val slf4j = "org.slf4j" % "slf4j-api" % "1.7.30"
val commonsCodec = "commons-codec" % "commons-codec" % "1.10"
val json = "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "provided"
val rx = "org.reactivestreams" % "reactive-streams" % rxStreamsVersion
val reactorAdapter = "io.projectreactor.addons" % "reactor-adapter" % reactorVersion
val reactorTest = "io.projectreactor" % "reactor-test" % reactorVersion % "test"
val rxJava = "io.reactivex.rxjava3" % "rxjava" % rxJavaVersion
val specs2 = "org.specs2" %% "specs2-core" % "4.9.3" % "test"
val slf4jSimple = "org.slf4j" % "slf4j-simple" % "1.7.30" % "test"
val wiremock = "com.github.tomakehurst" % "wiremock-jre8" % "2.26.3" % "test"
val junitInterface = "com.novocode" % "junit-interface" % "0.11" % Test
val jsonPath = "com.jayway.jsonpath" % "json-path" % "2.4.0" % "test"
val commonDependencies = Seq(
asyncClient,
slf4j,
commonsCodec,
json
)
val rxJavaDependencies = Seq(
rxJava
)
lazy val interopDependencies = Seq(
rx,
reactorAdapter,
reactorTest
)
val javaDependencies = commonDependencies ++ Seq(slf4jSimple)
val scalaDependencies = commonDependencies ++ Seq(
specs2
)
val fs2Dependencies = commonDependencies ++ scalaDependencies ++ Seq(
"co.fs2" %% "fs2-core" % fs2Version % "provided",
"co.fs2" %% "fs2-reactive-streams" % fs2Version % "provided"
)
val mainTestDependencies = Seq(
slf4jSimple,
wiremock,
junitInterface,
jsonPath
)
lazy val disablePublishingRoot = Seq(
Keys.publishLocal := {},
Keys.publish := {},
publish / skip := true
)
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
lazy val supportedScalaVersions = Seq("2.12.2", "2.13.0")
lazy val extraScalaSettings = Seq(
crossScalaVersions := supportedScalaVersions
)
lazy val moduleSettings =
Seq(
organization := "be.wegenenverkeer",
version := Version,
scalaVersion := ScalaVersion,
scalacOptions := ScalaBuildOptions,
parallelExecution := false,
parallelExecution in Test := false,
test / fork := true,
resolvers += "Local Maven" at Path.userHome.asFile.toURI.toURL + ".m2/repository",
resolvers += Resolver.typesafeRepo("releases"),
resolvers += "Spring repository" at "https://repo.spring.io/milestone"
) ++ testSettings ++ publishSettings //++ jacoco.settings
lazy val extraJavaSettings = Seq(
crossPaths := false,
crossScalaVersions := List("2.12.2"),
autoScalaLibrary := false,
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
javacOptions ++= Seq("--release", "11"),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v")
)
lazy val testSettings = Seq(
libraryDependencies ++= mainTestDependencies,
parallelExecution in Test := false
)
lazy val javaInterop = (project in file("modules/java-interop")).settings(
name := "RxHttpClient-interop",
moduleSettings ++ extraJavaSettings,
libraryDependencies ++= javaDependencies ++ interopDependencies,
extraJavaSettings
) dependsOn (java % "compile->compile;test->test")
lazy val fs2 = (project in file("modules/fs2")).settings(
name := "RxHttpclient-fs2",
moduleSettings ++ extraScalaSettings,
libraryDependencies ++= fs2Dependencies
).dependsOn(java % "compile->compile;test->test")
lazy val java = (project in file("modules/java")).settings(
name := "RxHttpClient",
moduleSettings,
libraryDependencies ++= javaDependencies ++ rxJavaDependencies,
extraJavaSettings
)
lazy val main = (project in file("."))
.settings(
moduleSettings ++ disablePublishingRoot ++ extraJavaSettings,
crossScalaVersions := Nil,
name := "RxHttpClient"
)
.aggregate(javaInterop, java, fs2)
lazy val pomInfo = <url>https://github.com/WegenenVerkeer/atomium</url>
<licenses>
<license>
<name>MIT licencse</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:WegenenVerkeer/atomium.git</url>
<connection>scm:git:[email protected]:WegenenVerkeer/atomium.git</connection>
</scm>
<developers>
<developer>
<id>AWV</id>
<name>De ontwikkelaars van AWV</name>
<url>http://www.wegenenverkeer.be</url>
</developer>
</developers>
val publishingCredentials = (for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield {
Seq(
Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password))
}).getOrElse(Seq())
val publishSettings = Seq(
publishMavenStyle := true,
pomIncludeRepository := { _ =>
false
},
publishTo := sonatypePublishToBundle.value,
pomExtra := pomInfo,
credentials ++= publishingCredentials
)