forked from jamshedmelik/hyperion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
221 lines (206 loc) · 7.67 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
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
val hyperionVersion = "5.7.2"
val scala211Version = "2.11.12"
val scala212Version = "2.12.9"
val awsSdkVersion = "[1.11.238, 1.12.0)"
val mailVersion = "1.6.1"
val slf4jVersion = "1.7.25"
val nscalaTimeArtifact = "com.github.nscala-time" %% "nscala-time" % "2.18.0"
val jodaConvertArtifact = "org.joda" % "joda-convert" % "2.0" % "provided"
val json4sJacksonArtifact = "org.json4s" %% "json4s-jackson" % "3.5.3"
val scoptArtifact = "com.github.scopt" %% "scopt" % "3.7.0"
val jschArtifact = "com.jcraft" % "jsch" % "0.1.54"
val configArtifact = "com.typesafe" % "config" % "1.3.2"
val commonsIoArtifact = "commons-io" % "commons-io" % "2.6"
val commonsCompressArtifact = "org.apache.commons" % "commons-compress" % "1.19"
val awsDatapipelineArtifact = "com.amazonaws" % "aws-java-sdk-datapipeline" % awsSdkVersion
val awsStsArtifact = "com.amazonaws" % "aws-java-sdk-sts" % awsSdkVersion
val awsS3Artifact = "com.amazonaws" % "aws-java-sdk-s3" % awsSdkVersion
val awsSqsArtifact = "com.amazonaws" % "aws-java-sdk-sqs" % awsSdkVersion
val awsSnsArtifact = "com.amazonaws" % "aws-java-sdk-sns" % awsSdkVersion
val mailArtifact = "com.sun.mail" % "mailapi" % mailVersion
val smtpArtifact = "com.sun.mail" % "smtp" % mailVersion
val slf4jApiArtifact = "org.slf4j" % "slf4j-api" % slf4jVersion
val slf4jSimpleArtifact = "org.slf4j" % "slf4j-simple" % slf4jVersion
val scalatestArtifact = "org.scalatest" %% "scalatest" % "3.0.5" % "test"
val scalacheckArtifact = "org.scalacheck" %% "scalacheck" % "1.13.5" % "test"
val stubbornArtifact = "com.krux" %% "stubborn" % "1.4.1"
scalaVersion in ThisBuild := scala212Version
lazy val publishSettings = Seq(
sonatypeProfileName := "com.krux",
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
pgpSecretRing := file("secring.asc"),
pgpPublicRing := file("pubring.asc"),
licenses := Seq("Apache-2.0" -> url("http://opensource.org/licenses/Apache-2.0")),
homepage := Some(url("https://github.com/krux/hyperion")),
scmInfo := Some(
ScmInfo(
url("https://github.com/krux/hyperion"),
"scm:git:[email protected]:krux/hyperion.git"
)
),
developers := List(
Developer(id = "realstraw", name = "Kexin Xie", email = "[email protected]", url = url("http://github.com/realstraw")),
Developer(id = "sethyates", name = "Seth Yates", email = "[email protected]", url = url("http://github.com/sethyates"))
),
publishTo := {
if (isSnapshot.value)
Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
else
Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
)
lazy val noPublishSettings = Seq(
publishArtifact := false,
publish := {},
publishLocal := {},
// to fix the problem of "Repository for publishing is not specified."
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo")))
)
lazy val commonSettings = Seq(
organization := "com.krux",
version := hyperionVersion,
crossScalaVersions := Seq(
scala211Version,
scala212Version
),
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-Xlint",
"-Xfatal-warnings",
"-language:existentials"
),
scalacOptions in (Compile, doc) ++= Seq(
"-sourcepath", (baseDirectory in ThisBuild).value.toString,
"-doc-source-url", s"https://github.com/krux/hyperion/tree/master/€{FILE_PATH}.scala"
),
libraryDependencies += scalatestArtifact,
libraryDependencies += scalacheckArtifact,
test in assembly := {} // skip test during assembly
)
// for modules that are not intended to be published as libraries but executable jars
lazy val artifactSettings = commonSettings ++ Seq(
artifact in (Compile, assembly) := {
val art = (artifact in (Compile, assembly)).value
art.withClassifier(Some("assembly"))
},
addArtifact(artifact in (Compile, assembly), assembly)
)
lazy val root = (project in file(".")).
settings(commonSettings: _*).
settings(publishSettings: _*).
enablePlugins(ScalaUnidocPlugin).
enablePlugins(SiteScaladocPlugin).
enablePlugins(GhpagesPlugin).
settings(
name := "hyperion",
siteSubdirName in ScalaUnidoc := "latest/api",
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), siteSubdirName in ScalaUnidoc),
git.remoteRepo := "[email protected]:krux/hyperion.git"
).
dependsOn(
core,
contribActivityDefinition
).
aggregate(
core,
examples,
contribActivityDefinition,
contribActivitySftp,
contribActivityEmail,
contribActivityNotification,
contribActivityFile,
contribActivityS3
)
lazy val core = (project in file("core")).
enablePlugins(BuildInfoPlugin).
settings(commonSettings: _*).
settings(publishSettings: _*).
settings(
name := "hyperion-core",
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "com.krux.hyperion",
libraryDependencies ++= Seq(
awsDatapipelineArtifact,
awsStsArtifact,
nscalaTimeArtifact,
json4sJacksonArtifact,
scoptArtifact,
configArtifact,
slf4jApiArtifact,
stubbornArtifact
)
)
lazy val examples = (project in file("examples")).
settings(commonSettings: _*).
settings(noPublishSettings: _*).
settings(
name := "hyperion-examples",
libraryDependencies += slf4jSimpleArtifact
).
dependsOn(core, contribActivityDefinition)
lazy val contribActivityDefinition = (project in file("contrib/activity/definition")).
settings(commonSettings: _*).
settings(publishSettings: _*).
settings(
name := "hyperion-activities"
).
dependsOn(core)
lazy val contribActivitySftp = (project in file("contrib/activity/sftp")).
settings(artifactSettings: _*).
settings(publishSettings: _*).
settings(
name := "hyperion-sftp-activity",
libraryDependencies ++= Seq(
scoptArtifact,
awsS3Artifact,
jschArtifact,
jodaConvertArtifact
)
)
lazy val contribActivityFile = (project in file("contrib/activity/file")).
settings(artifactSettings: _*).
settings(publishSettings: _*).
settings(
name := "hyperion-file-activity",
libraryDependencies ++= Seq(
scoptArtifact,
commonsIoArtifact,
commonsCompressArtifact
)
)
lazy val contribActivityEmail = (project in file("contrib/activity/email")).
settings(artifactSettings: _*).
settings(publishSettings: _*).
settings(
name := "hyperion-email-activity",
libraryDependencies ++= Seq(
scoptArtifact,
mailArtifact,
smtpArtifact
)
)
lazy val contribActivityNotification = (project in file("contrib/activity/notification")).
settings(artifactSettings: _*).
settings(publishSettings: _*).
settings(
name := "hyperion-notification-activity",
libraryDependencies ++= Seq(
scoptArtifact,
json4sJacksonArtifact,
awsSnsArtifact,
awsSqsArtifact,
smtpArtifact
)
)
lazy val contribActivityS3 = (project in file("contrib/activity/s3")).
settings(artifactSettings: _*).
settings(publishSettings: _*).
settings(
name := "hyperion-s3-activity",
libraryDependencies ++= Seq(
scoptArtifact,
awsS3Artifact
)
)