forked from jhc-systems/sqlest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
146 lines (136 loc) · 4.69 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
import com.typesafe.sbt.pgp.PgpKeys
import com.typesafe.sbt.SbtGit.GitKeys.gitRemoteRepo
import com.typesafe.sbt.SbtGhPages
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import com.typesafe.sbt.SbtSite
import ReleaseTransformations._
import scalariform.formatter.preferences._
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(sqlest, extractors, examples)
lazy val sqlest = (project in file("sqlest"))
.enablePlugins(spray.boilerplate.BoilerplatePlugin)
.settings(moduleName := "sqlest")
.settings(sqlestSettings: _*)
.settings(
tutSourceDirectory := file("docs") / "sqlest",
tutTargetDirectory := file("."),
libraryDependencies ++= Seq("com.typesafe.scala-logging" %% "scala-logging" % "3.5.0")
).dependsOn(extractors)
lazy val extractors = (project in file("extractors"))
.enablePlugins(spray.boilerplate.BoilerplatePlugin)
.settings(moduleName := "sqlest-extractors")
.settings(sqlestSettings: _*)
.settings(
tutSourceDirectory := file("docs") / "extractors",
tutTargetDirectory := file("extractors"),
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"joda-time" % "joda-time" % "2.3",
"org.joda" % "joda-convert" % "1.6"
)
)
lazy val examples = (project in file("examples"))
.settings(commonSettings: _*)
.settings(noPublishSettings: _*)
.settings(libraryDependencies += "com.h2database" % "h2" % "1.4.180")
.dependsOn(sqlest)
lazy val commonSettings = SbtScalariform.scalariformSettings ++ publishingSettings ++ Seq(
organization := "uk.co.jhc",
scalaVersion := "2.12.1",
crossScalaVersions := List("2.11.8", "2.12.1"),
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-Xfuture"
),
coverageExcludedPackages := "sqlest.examples",
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(DanglingCloseParenthesis, Preserve)
)
lazy val sqlestSettings = commonSettings ++ scaladocSettings ++ tutSettings ++ Seq(
tutNameFilter := """README.md""".r,
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"com.chuusai" %% "shapeless" % "2.3.2" % "test",
"com.h2database" % "h2" % "1.4.180" % "test"
)
)
lazy val noPublishSettings = Seq(
publish := (),
publishLocal := (),
publishArtifact := false
)
lazy val scaladocSettings = SbtSite.site.settings ++ SbtSite.site.includeScaladoc() ++ SbtGhPages.ghpages.settings ++ Seq(
gitRemoteRepo := "[email protected]:jhc-systems/sqlest.git"
)
lazy val publishingSettings = sonatypeReleaseProcess ++ Seq(
// Publishing - http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishMavenStyle := true,
publishArtifact in Test := false,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
credentials := {
Seq("SONATYPE_USER", "SONATYPE_PASSWORD").map(sys.env.get) match {
case Seq(Some(user), Some(password)) =>
Seq(Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, password))
case _ =>
credentials.value
}
},
pomIncludeRepository := { _ => false },
pomExtra := (
<url>https://github.com/jhc-systems/sqlest</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]/jhc-systems/sqlest.git</url>
<connection>scm:git:[email protected]/jhc-systems/sqlest.git</connection>
</scm>
<developers>
<developer>
<id>davegurnell</id>
<name>Dave Gurnell</name>
</developer>
<developer>
<id>brendanator</id>
<name>Brendan Maginnis</name>
</developer>
</developers>)
)
lazy val sonatypeReleaseProcess = Seq(
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _), enableCrossBuild = true),
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _), enableCrossBuild = true),
pushChanges
)
)