forked from waylayio/kairosdb-scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
117 lines (101 loc) · 3.72 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
import sbt.Keys.thisProjectRef
ThisBuild / organization := "io.waylay.kairosdb"
val playWsVersion = "2.1.10"
val playJsonVersion = "2.9.2"
val specs2Version = "4.15.0"
val dockerTestkitVersion = "0.11.0"
val scalaTestVersion = "3.2.12"
val playVersion = "2.8.14" // test only
val scala2_12 = "2.12.15"
val scala2_13 = "2.13.8"
ThisBuild / scalaVersion := scala2_13
ThisBuild / crossScalaVersions := Seq(scala2_12, scala2_13)
releaseCrossBuild := true
// we need both Test and IntegrationTest scopes for a correct pom, see https://github.com/sbt/sbt/issues/1380
val TestAndIntegrationTest = IntegrationTest.name + "," + Test.name
val exclusions = Seq(
"netty-codec",
"netty-handler-proxy",
"netty-handler",
"netty-transport-native-epoll",
"netty-codec-socks",
"netty-codec-http"
).map(name => ExclusionRule(organization = "io.netty", name = name))
lazy val root = (project in file("."))
.settings(
name := "kairosdb-scala",
Test / fork := true,
IntegrationTest / parallelExecution := false,
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.6.18",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.7.0",
"com.typesafe.play" %% "play-json" % playJsonVersion,
"com.typesafe.play" %% "play-ws-standalone" % playWsVersion,
"com.typesafe.play" %% "play-ws-standalone-json" % playWsVersion,
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"io.lemonlabs" %% "scala-uri" % "4.0.2",
// TEST
"org.specs2" %% "specs2-core" % specs2Version % Test,
"org.specs2" %% "specs2-junit" % specs2Version % Test,
"de.leanovate.play-mockws" %% "play-mockws" % "2.8.1" % Test,
"com.typesafe.play" %% "play-ahc-ws" % playVersion % TestAndIntegrationTest, // neede for play-mockws
"com.typesafe.play" %% "play-test" % playVersion % TestAndIntegrationTest, // play-mockws depends on some types in this dependency
"com.typesafe.play" %% "play-ahc-ws-standalone" % playWsVersion % TestAndIntegrationTest,
// INTEGRATION TESTS
// TODO investigate if we can do this with specs2
"org.scalatest" %% "scalatest-wordspec" % scalaTestVersion % TestAndIntegrationTest,
"org.scalatest" %% "scalatest-mustmatchers" % scalaTestVersion % TestAndIntegrationTest,
"com.whisk" %% "docker-testkit-scalatest" % dockerTestkitVersion % TestAndIntegrationTest excludeAll (exclusions: _*)
),
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-unchecked",
"-encoding",
"UTF-8", // yes, this is 2 args
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xlint",
"-Ywarn-dead-code"
)
)
.configs(IntegrationTest)
.settings(Defaults.itSettings: _*)
enablePlugins(GhpagesPlugin)
enablePlugins(SiteScaladocPlugin)
val publishScalaDoc = (ref: ProjectRef) =>
ReleaseStep(
action = releaseStepTaskAggregated(ref / ghpagesPushSite) // publish scaladoc
)
val runIntegrationTest = (ref: ProjectRef) =>
ReleaseStep(
action = releaseStepTaskAggregated(test in IntegrationTest in ref)
)
releaseProcess := {
import sbtrelease.ReleaseStateTransformations._
Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
runIntegrationTest(thisProjectRef.value),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
publishScalaDoc(thisProjectRef.value),
setNextVersion,
commitNextVersion,
pushChanges
)
}
git.remoteRepo := "[email protected]:waylayio/kairosdb-scala.git"
lazy val examples = project
.dependsOn(root)
.settings(
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-ahc-ws-standalone" % playWsVersion
)
)