-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
123 lines (93 loc) · 3.4 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
import SonatypeKeys._
import sbt.CrossVersion
// Metadata
organization := "com.codemettle.akka-solr"
name := "akka-solr"
description := "Solr HTTP client using Akka and Spray"
startYear := Some(2014)
homepage := Some(url("https://github.com/CodeMettle/akka-solr"))
organizationName := "CodeMettle, LLC"
organizationHomepage := Some(url("http://www.codemettle.com"))
licenses += ("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
scmInfo := Some(
ScmInfo(url("https://github.com/CodeMettle/akka-solr"), "scm:git:https://github.com/CodeMettle/akka-solr.git",
Some("scm:git:git@github.com:CodeMettle/akka-solr.git")))
pomExtra := {
<developers>
<developer>
<name>Steven Scott</name>
<email>steven@codemettle.com</email>
<url>https://github.com/codingismy11to7/</url>
</developer>
<developer>
<name>Cliff Ford</name>
<email>cliff@codemettle.com</email>
<url>https://github.com/compfix/</url>
</developer>
</developers>
}
// Build
crossScalaVersions := Seq("2.11.11", "2.12.5", "2.13.0")
scalaVersion := crossScalaVersions.value.last
scalacOptions ++= Seq("-unchecked", "-feature", "-deprecation")
libraryDependencies ++= Seq(
Deps.akkaActor,
Deps.akkaStream,
Deps.solrj % Provided,
Deps.akkaHttpCore
)
libraryDependencies ++= Seq(
Deps.akkaSlf,
Deps.akkaTest,
Deps.ficus,
Deps.solrj, // explicitly include even though not technically needed
Deps.jclOverSlf4j,
Deps.logback,
Deps.scalaTest
) map (_ % Test)
scalacOptions += {
CrossVersion partialVersion scalaVersion.value match {
case Some((x, y)) if x >= 2 && y >= 12 => "-target:jvm-1.8"
case _ => "-target:jvm-1.6"
}
}
unmanagedSourceDirectories in Compile ++= {
(unmanagedSourceDirectories in Compile).value.map { dir =>
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => file(dir.getPath ++ "-2.13+")
case _ => file(dir.getPath ++ "-2.13-")
}
}
}
publishArtifact in Test := true
autoAPIMappings := true
apiMappings ++= {
val cp: Seq[Attributed[File]] = (fullClasspath in Compile).value
def findManagedDependency(moduleId: ModuleID): File = {
( for {
entry ← cp
module ← entry.get(moduleID.key)
if module.organization == moduleId.organization
if module.name startsWith moduleId.name
jarFile = entry.data
} yield jarFile
).head
}
Map(
findManagedDependency("org.scala-lang" % "scala-library" % scalaVersion.value) -> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/"),
findManagedDependency(Deps.akkaActor) -> url(s"http://doc.akka.io/api/akka/${Versions.akka}/"),
findManagedDependency(Deps.solrj) -> url(s"https://lucene.apache.org/solr/${Versions.solr.replace('.', '_')}/solr-solrj/")
)
}
// internal release
//publishMavenStyle := true
//
//publishTo := Some(Resolver.ssh("CodeMettle Maven", "maven.codemettle.com",
// s"archiva/data/repositories/${if (isSnapshot.value) "snapshots" else "internal"}/") as
// ("archiva", Path.userHome / ".ssh" / "id_rsa"))
// Release
releasePublishArtifactsAction := PgpKeys.publishSigned.value
releaseCrossBuild := true
// Publish
xerial.sbt.Sonatype.sonatypeSettings
profileName := "com.codemettle"