forked from hseeberger/constructr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
161 lines (147 loc) · 5.45 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
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val constructr =
project
.in(file("."))
.enablePlugins(GitVersioning)
.aggregate(core, coordination, `coordination-etcd`)
.settings(settings)
.settings(
unmanagedSourceDirectories.in(Compile) := Seq.empty,
unmanagedSourceDirectories.in(Test) := Seq.empty,
publishArtifact := false
)
lazy val core =
project
.enablePlugins(AutomateHeaderPlugin)
.configs(MultiJvm)
.dependsOn(coordination,`coordination-etcd` % "test->compile")
.settings(settings)
.settings(multiJvmSettings)
.settings(
name := "constructr",
libraryDependencies ++= Seq(
library.akkaCluster,
library.akkaLog4j % Test,
library.akkaMultiNodeTestkit % Test,
library.akkaTestkit % Test,
library.log4jCore % Test,
library.mockitoCore % Test,
library.scalaTest % Test
)
)
lazy val coordination =
project
.enablePlugins(AutomateHeaderPlugin)
.settings(settings)
.settings(
name := "constructr-coordination",
libraryDependencies ++= Seq(
library.akkaActor
)
)
lazy val `coordination-etcd` =
project
.enablePlugins(AutomateHeaderPlugin)
.dependsOn(coordination)
.settings(settings)
.settings(
name := "constructr-coordination-etcd",
libraryDependencies ++= Seq(
library.akkaHttp,
library.akkaStream,
library.circeParser,
library.akkaTestkit % Test,
library.scalaTest % Test
)
)
// *****************************************************************************
// Library dependencies
// *****************************************************************************
lazy val library =
new {
object Version {
final val akka = "2.5.6"
final val akkaHttp = "10.0.10"
final val akkaLog4j = "1.5.0"
final val circe = "0.8.0"
final val log4j = "2.9.1"
final val mockito = "2.7.22"
final val scalaTest = "3.0.4"
}
val akkaActor = "com.typesafe.akka" %% "akka-actor" % Version.akka
val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % Version.akka
val akkaHttp = "com.typesafe.akka" %% "akka-http" % Version.akkaHttp
val akkaLog4j = "de.heikoseeberger" %% "akka-log4j" % Version.akkaLog4j
val akkaMultiNodeTestkit = "com.typesafe.akka" %% "akka-multi-node-testkit" % Version.akka
val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % Version.akka
val akkaStream = "com.typesafe.akka" %% "akka-stream" % Version.akka
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % Version.akka
val circeParser = "io.circe" %% "circe-parser" % Version.circe
val log4jCore = "org.apache.logging.log4j" % "log4j-core" % Version.log4j
val mockitoCore = "org.mockito" % "mockito-core" % Version.mockito
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
}
// *****************************************************************************
// Settings
// ***************************************************************************** |
lazy val settings =
commonSettings ++
gitSettings ++
scalafmtSettings ++
publishSettings ++
multiJvmSettings ++
bintraySettings
lazy val commonSettings =
Seq(
// scalaVersion from .travis.yml
// crossScalaVersions from .travis.yml
organization := "de.heikoseeberger",
organizationName := "Heiko Seeberger",
startYear := Some(2015),
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-target:jvm-1.8",
"-encoding", "UTF-8"
),
unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value)
)
lazy val gitSettings =
Seq(
git.useGitDescribe := true
)
lazy val scalafmtSettings =
Seq(
scalafmtOnCompile := true,
scalafmtOnCompile.in(Sbt) := false,
scalafmtVersion := "1.3.0"
)
lazy val publishSettings =
Seq(
homepage := Some(url("https://github.com/hseeberger/constructr")),
scmInfo := Some(ScmInfo(url("https://github.com/hseeberger/constructr"),
"[email protected]:hseeberger/constructr.git")),
developers += Developer("hseeberger",
"Heiko Seeberger",
url("https://github.com/hseeberger")),
pomIncludeRepository := (_ => false)
)
lazy val bintraySettings =
Seq(
bintrayPackage := "constructr"
)
lazy val multiJvmSettings =
com.typesafe.sbt.SbtMultiJvm.multiJvmSettings ++
inConfig(MultiJvm)(scalafmtSettings) ++
headerSettings(MultiJvm) ++
automateHeaderSettings(MultiJvm) ++
Seq(
unmanagedSourceDirectories.in(MultiJvm) := Seq(scalaSource.in(MultiJvm).value),
test.in(Test) := test.in(MultiJvm).dependsOn(test.in(Test)).value
)