forked from ixias-net/ixias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
188 lines (173 loc) · 7.34 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
/*
* This file is part of the ixias service.
*
* For the full copyright and license information,
* please view the LICENSE file that was distributed with this source code.
*/
lazy val commonSettings = Seq(
organization := "net.ixias",
scalaVersion := "2.12.2",
resolvers ++= Seq(
"Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/",
"Sonatype Release" at "https://oss.sonatype.org/content/repositories/releases/",
"Sonatype Snapshot" at "https://oss.sonatype.org/content/repositories/snapshots/",
"keyczar" at "https://raw.githubusercontent.com/google/keyczar/master/java/maven/"
),
// Scala compile options
scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xlint:-unused,_", // Enable recommended additional warnings.
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver.
"-Ywarn-dead-code", // Warn when dead code is identified.
"-Ywarn-unused:imports", // Warn if an import selector is not referenced.
"-Ywarn-inaccessible", // Warn about inaccessible types in method signatures.
"-Ywarn-nullary-override", // Warn when non-nullary overrides nullary, e.g. def foo() over def foo.
"-Ywarn-numeric-widen" // Warn when numerics are widened.
),
libraryDependencies ++= Seq(
"org.specs2" %% "specs2-core" % "3.9.1" % Test,
"org.specs2" %% "specs2-matcher-extra" % "3.9.1" % Test,
"ch.qos.logback" % "logback-classic" % "1.1.3" % Test,
"mysql" % "mysql-connector-java" % "5.1.39" % Test
)
)
lazy val playSettings = Seq(
unmanagedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "scala",
unmanagedSourceDirectories in Test += baseDirectory.value / "src" / "test" / "scala",
unmanagedResourceDirectories in Test += baseDirectory.value / "src" / "test" / "resources",
libraryDependencies ++= Seq(ws, ehcache)
)
// Publisher Setting
//~~~~~~~~~~~~~~~~~~~
import ReleaseTransformations._
lazy val publisherSettings = Seq(
publishTo := {
val branch = "git branch".lines_!.find{_.head == '*'}.map{_.drop(2)}.getOrElse("")
val release = (branch == "master" || branch.startsWith("release"))
val path = if (release) "releases" else "snapshots"
Some("Nextbeat snapshots" at "s3://maven.ixias.net.s3-ap-northeast-1.amazonaws.com/" + path)
},
publishArtifact in (Compile, packageDoc) := false, // disable publishing the Doc jar
publishArtifact in (Compile, packageSrc) := false, // disable publishing the sources jar
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
pushChanges
)
)
// IxiaS Core Libraries
//~~~~~~~~~~~~~~~~~~~~~~~~~~~
lazy val ixiasCore = (project in file("framework/ixias-core"))
.settings(name := "ixias-core")
.settings(commonSettings: _*)
.settings(publisherSettings: _*)
.settings(libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.2",
"com.typesafe" % "config" % "1.3.0",
"com.typesafe.slick" %% "slick" % "3.2.1",
"org.typelevel" %% "cats" % "0.8.1",
"io.monix" %% "shade" % "1.9.5",
"com.zaxxer" % "HikariCP" % "2.5.0",
"org.keyczar" % "keyczar" % "0.71h",
"org.uaparser" %% "uap-scala" % "0.1.0",
"commons-codec" % "commons-codec" % "1.10",
"joda-time" % "joda-time" % "2.9.4",
"org.slf4j" % "slf4j-api" % "1.7.21"
))
lazy val ixiasMail = (project in file("framework/ixias-mail"))
.settings(name := "ixias-mail")
.dependsOn(ixiasCore)
.settings(commonSettings: _*)
.settings(publisherSettings: _*)
.settings(libraryDependencies ++= Seq(
"com.google.inject" % "guice" % "4.1.0",
"com.twilio.sdk" % "twilio-java-sdk" % "6.3.0",
"org.apache.commons" % "commons-email" % "1.4"
))
lazy val awsSdkVersion = "1.11.156"
lazy val ixiasAwsSns = (project in file("framework/ixias-aws-sns"))
.settings(name := "ixias-aws-sns")
.dependsOn(ixiasCore)
.settings(commonSettings: _*)
.settings(publisherSettings: _*)
.settings(libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk-sns" % awsSdkVersion
))
lazy val ixiasAwsS3 = (project in file("framework/ixias-aws-s3"))
.settings(name := "ixias-aws-s3")
.dependsOn(ixiasCore)
.settings(commonSettings: _*)
.settings(publisherSettings: _*)
.settings(libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk-s3" % awsSdkVersion
))
// IxiaS Play Libraries
//~~~~~~~~~~~~~~~~~~~~~~~~~~~
lazy val ixiasPlayCore = (project in file("framework/ixias-play-core"))
.settings(name := "ixias-play-core")
.enablePlugins(PlayScala)
.dependsOn(ixiasCore)
.settings(commonSettings: _*)
.settings(playSettings: _*)
.settings(publisherSettings: _*)
lazy val ixiasPlayScalate = (project in file("framework/ixias-play-scalate"))
.settings(name := "ixias-play-scalate")
.enablePlugins(PlayScala)
.dependsOn(ixiasCore)
.settings(commonSettings: _*)
.settings(playSettings: _*)
.settings(publisherSettings: _*)
.settings(libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
"org.scalatra.scalate" %% "scalate-core" % "1.8.0"
))
lazy val ixiasPlayAuth = (project in file("framework/ixias-play-auth"))
.settings(name := "ixias-play-auth")
.enablePlugins(PlayScala)
.dependsOn(ixiasCore, ixiasPlayCore)
.settings(commonSettings: _*)
.settings(playSettings: _*)
.settings(publisherSettings: _*)
// IxiaS Meta Packages
//~~~~~~~~~~~~~~~~~~~~~
lazy val ixias = (project in file("."))
.settings(name := "ixias")
.settings(commonSettings: _*)
.settings(publisherSettings: _*)
.aggregate(ixiasCore, ixiasMail, ixiasAws, ixiasPlay)
.dependsOn(ixiasCore, ixiasMail)
lazy val ixiasAws = (project in file("target/ixias-aws"))
.settings(name := "ixias-aws")
.settings(commonSettings: _*)
.settings(publisherSettings: _*)
.aggregate(ixiasCore, ixiasAwsSns, ixiasAwsS3)
.dependsOn(ixiasCore, ixiasAwsSns, ixiasAwsS3)
lazy val ixiasPlay = (project in file("target/ixias-play"))
.settings(name := "ixias-play")
.settings(commonSettings: _*)
.settings(publisherSettings: _*)
.aggregate(ixiasPlayCore, ixiasPlayScalate, ixiasPlayAuth)
.dependsOn(ixiasPlayCore, ixiasPlayAuth)
// Setting for prompt
import com.scalapenos.sbt.prompt._
val defaultTheme = PromptTheme(List(
text("[SBT] ", fg(green)),
text(state => { Project.extract(state).get(organization) + "@" }, fg(magenta)),
text(state => { Project.extract(state).get(name) }, fg(magenta)),
text(":", NoStyle),
gitBranch(clean = fg(green), dirty = fg(yellow)).padLeft("[").padRight("]"),
text(" > ", NoStyle)
))
promptTheme := defaultTheme
shellPrompt := (implicit state => promptTheme.value.render(state))