-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
163 lines (140 loc) · 5.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
155
156
157
158
159
160
161
162
163
import ReleaseTransformations._
val jaxbApiV = "3.0.1"
val jaxbImplV = "3.0.2"
ThisBuild / versionScheme := Some("semver-spec")
lazy val root = Project("exist-algolia-index", file("."))
.settings(
name := "exist-algolia-index",
organization := "org.humanistika.exist.index.algolia",
scalaVersion := "2.13.12",
licenses := Seq("GNU General Public License, version 3" -> url("http://opensource.org/licenses/gpl-3.0")),
homepage := Some(url("https://github.com/bcdh/exist-algolia-index")),
startYear := Some(2016),
description := "An eXist-db Index Plugin for Indexing with Algolia",
organizationName := "Belgrade Center for Digital Humanities",
organizationHomepage := Some(url("http://bcdh.org")),
scmInfo := Some(ScmInfo(
url("https://github.com/bcdh/exist-algolia-index"),
"scm:[email protected]:bcdh/exist-algolia-index.git")
),
developers := List(
Developer(
id = "adamretter",
name = "Adam Retter",
email = "[email protected]",
url = url("https://www.evolvedbinary.com")
),
Developer(
id = "mamroure",
name = "Younes Bahloul",
email = "[email protected]",
url = url("https://www.evolvedbinary.com")
)
),
headerLicense := Some(HeaderLicense.GPLv3("2016", "Belgrade Center for Digital Humanities")),
xjcLibs := Seq(
"org.glassfish.jaxb" % "jaxb-xjc" % jaxbImplV,
"org.glassfish.jaxb" % "jaxb-runtime" % jaxbImplV
),
libraryDependencies ++= {
val catsCoreV = "2.10.0"
val existV = "6.3.0-SNAPSHOT"
val algoliaV = "2.19.0"
val akkaV = "2.6.20"
val jacksonV = "2.13.4"
Seq(
"org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2",
"org.typelevel" %% "cats-core" % catsCoreV,
"org.parboiled" %% "parboiled" % "2.5.0",
"jakarta.xml.bind" % "jakarta.xml.bind-api" % jaxbApiV % Provided,
"org.glassfish.jaxb" % "jaxb-runtime" % jaxbImplV % Provided,
"org.clapper" %% "grizzled-slf4j" % "1.3.4"
exclude("org.slf4j", "slf4j-api"),
"org.exist-db" % "exist-core" % existV % Provided,
"net.sf.saxon" % "Saxon-HE" % "9.9.1-8" % Provided,
"com.fasterxml.jackson.core" % "jackson-core" % jacksonV % Provided,
"commons-codec" % "commons-codec" % "1.15" % Provided,
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonV
exclude("com.fasterxml.jackson.core", "jackson-core"),
"com.algolia" % "algoliasearch" % algoliaV
exclude("org.apache.httpcomponents", "*"),
"com.algolia" % "algoliasearch-common" % algoliaV
exclude("com.fasterxml.jackson.core", "jackson-core")
exclude("com.fasterxml.jackson.core", "jackson-databind")
exclude("org.apache.commons", "commons-lang3")
exclude("org.slf4j", "slf4j-api"),
"com.typesafe.akka" %% "akka-actor" % akkaV,
"com.typesafe.akka" %% "akka-testkit" % akkaV,
"org.specs2" %% "specs2-core" % "4.20.2" % Test,
"org.easymock" % "easymock" % "3.6" % Test,
"org.exist-db" % "exist-start" % existV % Test,
"org.apache.httpcomponents" % "httpclient" % "4.5.14" % Test
)
},
publishMavenStyle := true,
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
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/")
},
Test / publishArtifact := false,
// scalacOptions in Test ++= Seq("-Yrangepos")
releaseVersionBump := sbtrelease.Version.Bump.Major,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
resolvers += Resolver.mavenLocal,
resolvers += "Evolved Binary eXist-db Release Maven Repo" at "https://repo.evolvedbinary.com/repository/exist-db/",
resolvers += "Evolved Binary eXist-db Snapshot Maven Repo" at "https://repo.evolvedbinary.com/repository/exist-db-snapshots/"
)
// Fancy up the Assembly JAR
Compile / packageBin / packageOptions += {
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.jar.Manifest
import scala.sys.process._
val gitCommit = "git rev-parse HEAD".!!.trim
val gitTag = s"git name-rev --tags --name-only $gitCommit".!!.trim
val additional = Map(
"Build-Timestamp" -> new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance.getTime),
"Built-By" -> sys.props("user.name"),
"Build-Tag" -> gitTag,
"Source-Repository" -> "scm:git:https://github.com/bcdh/exist-algolia-index.git",
"Git-Commit-Abbrev" -> gitCommit.substring(0, 7),
"Git-Commit" -> gitCommit,
"Build-Jdk" -> sys.props("java.runtime.version"),
"Description" -> "An eXist-db Index Plugin for Indexing with Algolia",
"Build-Version" -> "N/A",
"License" -> "GNU General Public License, version 3"
)
val manifest = new Manifest
val attributes = manifest.getMainAttributes
for((k, v) <- additional)
attributes.putValue(k, v)
Package.JarManifest(manifest)
}
Compile / assembly / artifact := {
val art = (Compile / assembly / artifact).value
art.withClassifier(Some("assembly"))
}
assembly / assemblyMergeStrategy := {
case PathList("META-INF", "versions", "9", xs @ _*) => MergeStrategy.discard
case x if x.endsWith("module-info.class") => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
addArtifact(Compile / assembly / artifact, assembly)
pomExtra := (
<developers>
<developer>
<id>adamretter</id>
<name>Adam Retter</name>
<url>http://www.adamretter.org.uk</url>
</developer>
</developers>
<scm>
<url>[email protected]:bcdh/exist-algolia-index.git</url>
<connection>scm:git:[email protected]:bcdh/exist-algolia-index.git</connection>
</scm>)