forked from paperlessreceipts/elasticrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
59 lines (51 loc) · 2.01 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
import java.io.File
import sbt.Keys.{name, resourceGenerators, version, _}
import sbt._
import sbtassembly.Plugin.AssemblyKeys._
val assembleZip = TaskKey[File]("assembleZip")
val zipArtifact = SettingKey[Artifact]("zipArtifact")
lazy val commonSettings = Seq(
name := "elasticsearch-encryption-plug-in",
organization := "com.workday",
version := "1.7.0",
crossScalaVersions := Seq("2.10.4", "2.11.8")
)
lazy val root = Project(id = "elasticsearch-encryption-plug-in", base = file("."))
.settings(assemblySettings: _*)
.settings(
commonSettings,
libraryDependencies ++= Seq(
"org.elasticsearch" % "elasticsearch" % "1.7.5-77" % "provided",
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.scoverage" %% "scalac-scoverage-runtime" % "1.0.4", // Need this for integration test
"org.mockito" % "mockito-all" % "1.9.5",
"org.apache.httpcomponents" % "httpclient" % "4.4",
"com.google.code.gson" % "gson" % "2.8.0"
),
assembleZip <<= (assembly, target, name, version) map {
(assembledJar: File, target: File, name: String, version: String) =>
val artifact = target / s"$name.zip"
IO.write(target / "VERSION", version)
val entries = Seq(
(assembledJar, s"$name.jar"),
(target / "VERSION", "VERSION")
)
IO.zip(entries, artifact)
artifact
},
zipArtifact := Artifact(s"${name.value}", "zip", "zip"),
// Use ScalaTest's built-in event buffering algorithm (shows events of 1 suite as they occur until suite completes/timeouts)
logBuffered in Test := false,
resourceGenerators in Compile <+=
(resourceManaged in Compile, name, version) map { (dir, n, v) =>
val file = dir / "elasticrypt.properties"
val contents =
s"""
|plugin=org.elasticsearch.plugins.ElasticryptPlugin
|version=$v
""".stripMargin
IO.write(file, contents)
Seq(file)
}
)
.settings(addArtifact(zipArtifact, assembleZip).settings: _*)