This repository has been archived by the owner on Oct 29, 2019. It is now read-only.
forked from nscala-time/nscala-time
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
117 lines (93 loc) · 3.25 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
import SonatypeKeys._
sonatypeSettings
organization := "com.github.nscala-time"
profileName := "com.github.nscala-time"
name := "nscala-time"
version := "0.8.0"
publishMavenStyle := true
crossScalaVersions := Seq("2.9.1", "2.9.2", "2.9.3", "2.10.3", "2.11.0-RC3")
scalacOptions <++= scalaVersion map { v =>
if (v.startsWith("2.9"))
Seq("-unchecked", "-deprecation")
else
Seq("-unchecked", "-deprecation", "-feature", "-language:implicitConversions")
}
val scaladocBranch = settingKey[String]("branch name for scaladoc -doc-source-url")
scaladocBranch := "master"
scalacOptions in (Compile, doc) ++= { Seq(
"-sourcepath", baseDirectory.value.getAbsolutePath,
"-doc-source-url", s"https://github.com/nscala-time/nscala-time/tree/${scaladocBranch.value}€{FILE_PATH}.scala"
)}
testOptions += Tests.Argument(TestFrameworks.Specs2, "console", "junitxml")
libraryDependencies ++= Seq(
"junit" % "junit" % "4.7" % "test",
"joda-time" % "joda-time" % "2.3",
"org.joda" % "joda-convert" % "1.2"
)
libraryDependencies += {
if (scalaVersion.value.startsWith("2.1"))
"org.specs2" %% "specs2-junit" % "2.3.10" % "test"
else if (scalaVersion.value == "2.9.3")
"org.specs2" %% "specs2" % "1.12.4.1" % "test"
else
"org.specs2" %% "specs2" % "1.12.3" % "test"
}
unmanagedSourceDirectories in Compile <+= (scalaVersion, sourceDirectory in Compile){(v, dir) =>
if(v.startsWith("2.9"))
dir / "scala29"
else
dir / "scala210"
}
initialCommands in console += {
Iterator("org.joda.time._", "com.github.nscala_time.time.Imports._").map("import "+).mkString("\n")
}
pomExtra := (
<url>https://github.com/nscala-time/nscala-time</url>
<licenses>
<license>
<name>Apache</name>
<url>http://www.opensource.org/licenses/Apache-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:nscala-time/nscala-time.git</url>
<connection>scm:git:git@github.com:nscala-time/nscala-time.git</connection>
</scm>
<developers>
<developer>
<id>kmizu</id>
<name>Kota Mizushima</name>
<url>https://github.com/kmizu</url>
</developer>
</developers>
)
publishTo <<= version { v =>
val nexus = "http://oss.sonatype.org/"
if (v.endsWith("-SNAPSHOT"))
Some("snapshots" at nexus+"content/repositories/snapshots")
else
Some("releases" at nexus+"service/local/staging/deploy/maven2")
}
credentials ++= {
val sonatype = ("Sonatype Nexus Repository Manager", "oss.sonatype.org")
def loadMavenCredentials(file: java.io.File) : Seq[Credentials] = {
xml.XML.loadFile(file) \ "servers" \ "server" map (s => {
val host = (s \ "id").text
val realm = if (host == sonatype._2) sonatype._1 else "Unknown"
Credentials(realm, host, (s \ "username").text, (s \ "password").text)
})
}
val ivyCredentials = Path.userHome / ".ivy2" / ".credentials"
val mavenCredentials = Path.userHome / ".m2" / "settings.xml"
(ivyCredentials.asFile, mavenCredentials.asFile) match {
case (ivy, _) if ivy.canRead => Credentials(ivy) :: Nil
case (_, mvn) if mvn.canRead => loadMavenCredentials(mvn)
case _ => Nil
}
}
site.settings
site.includeScaladoc()
site.jekyllSupport()
ghpages.settings
git.remoteRepo := "git@github.com:nscala-time/nscala-time.git"