-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
92 lines (79 loc) · 2.92 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
lazy val root = project.in(file("."))
.aggregate(scalaad, breeze, nd4j)
.settings(commonSettings: _*)
.settings(name := "scalaad-root")
.settings(publish := { })
.settings(testSettings: _*)
lazy val scalaad = project.in(file("scalaad"))
.settings(commonSettings ++ commonPublishSettings:_*)
.settings(name := "scalaad")
lazy val breeze = project.in(file("breeze"))
.dependsOn(scalaad)
.settings(commonSettings ++ commonPublishSettings:_*)
lazy val nd4j = project.in(file("nd4j"))
.dependsOn(scalaad)
.settings(commonSettings ++ commonPublishSettings:_*)
lazy val example = project.in(file("example"))
.dependsOn(breeze)
.dependsOn(nd4j)
.dependsOn(scalaad)
.settings(commonSettings:_*)
lazy val commonSettings = Seq(
organization := "com.kogecoo",
name <<= name("scalaad-" + _),
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.11.8"),
scalacOptions ++= commonScalacOptions,
resolvers ++= commonResolvers,
libraryDependencies ++= commonLibraryDependencies
)
lazy val commonPublishSettings = Seq(
licenses := Seq("Apache License Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("http://kogecoo.github.com/scalaad")),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := (_ => false),
pomExtra := commonPomExtra,
publishTo <<= version { (v: String) => choosePublishTo(v) }
)
lazy val commonScalacOptions = Seq(
"-feature",
"-deprecation",
"-unchecked",
"-language:postfixOps",
"-Xlint",
"-Ywarn-dead-code"
)
lazy val commonResolvers = Seq(
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
"Sonatype release Repository" at "http://oss.sonatype.org/service/local/staging/deploy/maven2/",
"Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository/"
)
lazy val commonLibraryDependencies = Seq(
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
"org.scalatest" %% "scalatest" % "3.0.1" % "test"
)
lazy val commonPomExtra = {
<scm>
<url>[email protected]:kogecoo/scalaad.git</url>
<connection>scm:git:[email protected]:kogecoo/scalaad.git</connection>
</scm>
<developers>
<developer>
<id>kogecoo</id>
<name>kogecoo</name>
<url>http://kogecoo.github.com</url>
</developer>
</developers>
}
lazy val testSettings = Seq(
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "2"),
testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oDF")
)
def choosePublishTo(v: String) = {
if (v.trim.endsWith("SNAPSHOT"))
Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/temporary")))
else
Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/temporary")))
}