forked from edrevo/coinffeine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
68 lines (52 loc) · 2.18 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
import CoinffeineKeys._
import scala.collection.JavaConversions._
name := "coinffeine"
version in ThisBuild := "0.3-SNAPSHOT"
organization in ThisBuild := "com.coinffeine"
scalaVersion in ThisBuild := "2.11.4"
scalacOptions in ThisBuild ++= Seq(
"-deprecation", "-feature", "-language:postfixOps", "-language:existentials")
javaOptions in ThisBuild ++= {
def propertiesToCopy(property: Any): Boolean = property match {
case "config.resource" => true
case scalaKey: String if scalaKey.startsWith("scala.") => true
case _ => false
}
System.getProperties.entrySet().toSeq
.filter(e => propertiesToCopy(e.getKey))
.map(e => s"-D${e.getKey}=${e.getValue}")
}
javacOptions in ThisBuild ++= Seq("-source", "1.8")
// The following props are needed to avoid overriding max UDP sockets,
// which by default is too low for TomP2P. We have to run tests in fork mode with
// Java options merged from parent process and a custom one
javaOptions in ThisBuild += "-Dsun.net.maxDatagramSockets=128"
fork in ThisBuild := true
compileOrder in ThisBuild := CompileOrder.JavaThenScala
resolvers in ThisBuild ++= Seq(
"coinffeine-releases" at "http://repository.coinffeine.com/nexus/content/repositories/releases/",
"bitcoinj" at "http://distribution.bitcoinj.googlecode.com/git/releases/",
"sonatype-releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2/",
"Sonatype-repository" at "https://oss.sonatype.org/content/groups/public",
"typesafe" at "http://repo.typesafe.com/typesafe/releases/",
"tomp2p" at "http://tomp2p.net/dev/mvn/"
)
libraryDependencies in ThisBuild ++= Dependencies.loggingFacade ++ Dependencies.testLoggingBackend ++ Seq(
Dependencies.jodaTime,
Dependencies.scalatest % "test"
)
exportJars in ThisBuild := true
aggregate in release := false
release := {
val moduleOutputs = Seq(
(release in Build.headless).value,
(release in Build.gui).value
)
val releaseDir = target.value / "release" / version.value
IO.createDirectory(releaseDir)
for (output <- moduleOutputs) {
if (output.isDirectory) IO.copyDirectory(output, releaseDir / output.name, overwrite = true)
else IO.copyFile(output, releaseDir / output.name)
}
releaseDir
}