forked from cloudify/sPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
155 lines (115 loc) · 3.87 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
import SonatypeKeys._
releaseSettings
sonatypeSettings
name := "sPDF"
description := "Create PDFs using plain old HTML+CSS. Uses wkhtmltopdf on the back-end which renders HTML using Webkit."
homepage := Some(url("https://github.com/cloudify/sPDF"))
startYear := Some(2013)
licenses := Seq(
("MIT", url("http://opensource.org/licenses/MIT"))
)
organization := "io.github.cloudify"
/* scala versions and options */
scalaVersion := "2.10.4"
crossScalaVersions := Seq("2.9.3", "2.10.4", "2.11.2")
// release cross builds
ReleaseKeys.crossBuild := true
// These options will be used for *all* versions.
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-encoding", "UTF-8"
// "-Xcheckinit" // for debugging only, see https://github.com/paulp/scala-faq/wiki/Initialization-Order
// "-optimise" // this option will slow your build
)
scalacOptions ++= Seq(
"-Yclosure-elim",
"-Yinline"
)
// These language flags will be used only for 2.10.x.
// Uncomment those you need, or if you hate SIP-18, all of them.
scalacOptions <++= scalaVersion map { sv =>
if (sv startsWith "2.10") List(
"-Xverify",
"-Ywarn-all",
"-feature"
// "-language:postfixOps",
// "-language:reflectiveCalls",
// "-language:implicitConversions"
// "-language:higherKinds",
// "-language:existentials",
// "-language:experimental.macros",
// "-language:experimental.dynamics"
)
else Nil
}
fork in Test := true
parallelExecution in Test := false
/* sbt behavior */
logLevel in compile := Level.Warn
traceLevel := 5
offline := false
scmInfo := Some(
ScmInfo(
url("https://github.com/cloudify/sPDF"),
"scm:git:https://github.com/cloudify/sPDF.git",
Some("scm:git:[email protected]:cloudify/sPDF.git")
)
)
/* dependencies */
libraryDependencies ++= Seq (
"org.mockito" % "mockito-all" % "1.10.8" % "test"
)
def scalatestDependency(scalaVersion: String) = scalaVersion match {
case v if v.startsWith("2.9") => "org.scalatest" %% "scalatest" % "1.9.2" % "test"
case _ => "org.scalatest" %% "scalatest" % "2.2.2" % "test"
}
// use different versions of scalatest for different versions of scala
libraryDependencies <+= scalaVersion(scalatestDependency(_))
// add scala-xml dependency when needed (for Scala 2.11 and newer) in a robust way
// this mechanism supports cross-version publishing
// taken from: http://github.com/scala/scala-module-dependency-sample
libraryDependencies := {
CrossVersion.partialVersion(scalaVersion.value) match {
// if scala 2.11+ is used, add dependency on scala-xml module
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
libraryDependencies.value ++ Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.0.1",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.1"
)
case _ =>
libraryDependencies.value
}
}
/* publishing */
publishMavenStyle := true
publishTo <<= version { (v: String) =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
credentials += Credentials(Path.userHome / ".credentials.sonatype")
publishArtifact in Test := false
// publishArtifact in (Compile, packageDoc) := false
// publishArtifact in (Compile, packageSrc) := false
pomIncludeRepository := { _ => false }
pomExtra := (
<developers>
<developer>
<id>cloudify</id>
<name>Federico Feroldi</name>
<email>[email protected]</email>
<url>http://www.pixzone.com</url>
</developer>
</developers>
)
// Josh Suereth's step-by-step guide to publishing on sonatype
// http://www.scala-sbt.org/using_sonatype.html
site.settings
site.includeScaladoc()
ghpages.settings
git.remoteRepo := "[email protected]:cloudify/sPDF.git"
seq(lsSettings:_*)
(LsKeys.tags in LsKeys.lsync) := Seq("pdf", "webkit")