-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sbt
137 lines (112 loc) · 4.49 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
import scalariform.formatter.preferences._
name := "scala-migrations"
description := "Database migrations written in Scala."
homepage := Some(url("http://opensource.imageworks.com/?p=scalamigrations"))
startYear := Some(2008)
organization := "com.imageworks.scala-migrations"
organizationName := "Sony Pictures Imageworks"
organizationHomepage := Some(url("http://www.imageworks.com/"))
licenses += "New BSD License" -> url("http://opensource.org/licenses/BSD-3-Clause")
version := "1.1.2-SNAPSHOT"
scalaVersion := "2.11.12"
// For a single major Scala release, e.g. 2.x.y, include at most one
// Scala release candidate in crossScalaVersions, e.g. "2.x.y-RC3".
// When the Scala final release has been published, then replace the
// release candidate with the Scala final release.
crossScalaVersions := Seq("2.9.0", "2.9.0-1",
"2.9.1", "2.9.1-1",
"2.9.2", "2.9.3",
"2.10.4",
"2.11.4")
// Increase warnings generated by the Scala compiler.
//
// For Scala 2.10 and greater, pass "-feature" to scalac to enable
// warnings for use of features that should be explicitly imported,
// e.g. "import scala.language.implicitConversions" to enable implicit
// conversions. However, since Scala Migrations uses implicit
// conversions and to maintain source compatibility so that separate
// branches are not needed, pass "-language:implicitConversions" so
// that "-feature" can be used without generating spurious warnings.
scalacOptions <++= scalaVersion map { v: String =>
val options1 = "-deprecation" :: "-unchecked" :: Nil
if (v.startsWith("2.9.0")) {
options1
}
else {
val options2 = "-Xlint" :: options1
if (v.startsWith("2.9"))
options2
else
"-feature" :: "-language:implicitConversions" :: options2
}
}
libraryDependencies ++= Seq(
"com.google.code.findbugs" % "jsr305" % "2.0.3",
"com.novocode" % "junit-interface" % "0.10-M4" % "test",
"log4jdbc" % "log4jdbc" % "1.1" from "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/log4jdbc/log4jdbc4-1.1.jar",
"mysql" % "mysql-connector-java" % "[5.1.0,5.2)" % "test",
"org.apache.derby" % "derby" % "[10.5.3.0,10.12)" % "test",
"org.hamcrest" % "hamcrest-core" % "1.3" % "test",
"org.jmock" % "jmock-junit4" % "[2.8.0,3.0)" % "test",
"org.slf4j" % "slf4j-api" % "[1.5.8,2.0)",
"org.slf4j" % "slf4j-log4j12" % "[1.5.8,2.0)" % "test",
"postgresql" % "postgresql" % "9.1-901.jdbc4" % "test")
// Run unit tests serially otherwise races can occur between two
// threads checking if the 'schema_migrations' table exists and
// trying to create it.
parallelExecution in Test := false
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
scalariformSettings
ScalariformKeys.preferences := FormattingPreferences().
setPreference(AlignParameters, true).
setPreference(CompactControlReadability, true).
setPreference(DoubleIndentClassDeclaration, true)
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
pomExtra :=
<developers>
<developer>
<id>blair</id>
<name>Blair Zajac</name>
<email>[email protected]</email>
</developer>
<developer>
<id>jrray</id>
<name>J. Robert Ray</name>
<email>[email protected]</email>
</developer>
</developers>
<scm>
<connection>scm:git:[email protected]:imageworks/scala-migrations.git</connection>
<developerConnection>scm:git:[email protected]:imageworks/scala-migrations.git</developerConnection>
<url>[email protected]:imageworks/scala-migrations.git</url>
</scm>
// Do not include log4jdbc as a dependency.
pomPostProcess := { (node: scala.xml.Node) =>
val rewriteRule =
new scala.xml.transform.RewriteRule {
override def transform(n: scala.xml.Node): scala.xml.NodeSeq = {
val name = n.nameToString(new StringBuilder).toString
if ( (name == "dependency")
&& ((n \ "groupId").text == "log4jdbc")
&& ((n \ "artifactId").text == "log4jdbc")) {
scala.xml.NodeSeq.Empty
}
else {
n
}
}
}
val transformer = new scala.xml.transform.RuleTransformer(rewriteRule)
transformer.transform(node)(0)
}
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
useGpg := true
useGpgAgent := true