-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.sbt
162 lines (146 loc) · 5.19 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
import scala.sys.process.Process
import scala.util.Try
import java.net.InetAddress
import java.text.SimpleDateFormat
import java.util.Date
import Dependencies._
import sbt.Keys._
import sbt.Package.ManifestAttributes
import sbt.SbtExclusionRule
ivyScala := ivyScala.value map {
_.copy(overrideScalaVersion = true)
}
val scalaV = "2.11.11"
val gitRevision = Try(Process("git rev-parse HEAD").!!.stripLineEnd).getOrElse("?").trim.take(6)
lazy val core = (project in file("suuchi-core"))
.settings(
name := "suuchi-core",
libraryDependencies ++= coreDependencies
)
.settings(protoConfigurations: _*)
.settings(projectSettings: _*)
.settings(publishSettings: _*)
.settings(buildInfoSettings: _*)
.enablePlugins(BuildInfoPlugin)
lazy val rocksStore = (project in file("suuchi-rocksdb"))
.settings(
name := "suuchi-rocksdb",
libraryDependencies ++= rocksDBDependencies
)
.settings(projectSettings: _*)
.settings(publishSettings: _*)
.dependsOn(core)
lazy val examples = (project in file("suuchi-examples"))
.settings(
name := "suuchi-examples",
libraryDependencies ++= examplesDependencies
)
.settings(protoConfigurations: _*)
.settings(projectSettings: _*)
.settings(publishSettings: _*)
.dependsOn(core, rocksStore)
lazy val clusterAtomix = (project in file("suuchi-cluster-atomix"))
.settings(
name := "suuchi-cluster-atomix",
libraryDependencies ++= atomixDependencies
)
.settings(projectSettings: _*)
.settings(publishSettings: _*)
.dependsOn(core)
lazy val clusterScalecube = (project in file("suuchi-cluster-scalecube"))
.settings(
name := "suuchi-cluster-scalecube",
libraryDependencies ++= scalecubeDependencies
)
.settings(projectSettings: _*)
.settings(publishSettings: _*)
.dependsOn(core)
lazy val buildInfoSettings = Seq(
buildInfoPackage := "in.ashwanthkumar.suuchi.version",
buildInfoObject := "SuuchiBuildInfo",
buildInfoUsePackageAsPath := true,
buildInfoKeys := Seq[BuildInfoKey](
BuildInfoKey.action("buildDate")(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())),
BuildInfoKey.action("buildVersion")((version in ThisBuild).value),
BuildInfoKey.action("buildSha")(gitRevision)
)
)
lazy val projectSettings = net.virtualvoid.sbt.graph.Plugin.graphSettings ++ Seq(
organization := "in.ashwanthkumar",
scalaVersion := scalaV,
resolvers += Resolver.mavenLocal,
excludeDependencies ++= Seq(
SbtExclusionRule("cglib", "cglib-nodep"),
SbtExclusionRule("commons-beanutils", "commons-beanutils"),
SbtExclusionRule("commons-beanutils", "commons-beanutils-core")
),
parallelExecution in ThisBuild := false,
scalacOptions ++= Seq("-unchecked",
"-feature"
// , "-Ylog-classpath" // useful while debugging dependency classpath issues
)
)
lazy val publishSettings = Seq(
publishArtifact := true,
/* START - sonatype publish related settings */
releaseVersionBump := sbtrelease.Version.Bump.Next,
pgpSecretRing := file("local.secring.gpg"),
pgpPublicRing := file("local.pubring.gpg"),
// pgpPassphrase := Some(sys.env.getOrElse("GPG_PASSPHRASE", "").toCharArray),
pgpPassphrase := None,
useGpg := false,
/* END - sonatype publish related settings */
packageOptions := Seq(
ManifestAttributes(
("Built-By", InetAddress.getLocalHost.getHostName)
)),
crossScalaVersions := Seq(scalaV),
publishMavenStyle := true,
// disable publishing test jars
publishArtifact in Test := false,
// disable publishing the main docs jar
publishArtifact in(Compile, packageDoc) := false,
// disable publishing the main sources jar
publishArtifact in(Compile, packageSrc) := true,
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")
},
pomExtra :=
<url>https://github.com/ashwanthkumar/suuchi</url>
<licenses>
<license>
<name>Apache2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<scm>
<url>https://github.com/ashwanthkumar/suuchi</url>
<connection>scm:git:https://github.com/ashwanthkumar/suuchi.git</connection>
<tag>HEAD</tag>
</scm>
<developers>
<developer>
<email>[email protected]</email>
<name>Ashwanth Kumar</name>
<url>https://ashwanthkumar.in/</url>
<id>ashwanthkumar</id>
</developer>
<developer>
<email>[email protected]</email>
<name>Sriram Ramachandrasekaran</name>
<id>brewkode</id>
</developer>
</developers>
)
lazy val protoConfigurations: Seq[Def.Setting[_]] = Seq(
// Reset the managedSourceDirectories list with just protobuf so we don't have the parent main directory
// in the classpath which causes issues in IDEA everytime we refresh the project
managedSourceDirectories in Compile ++= Seq((target in Compile).value / "protobuf-generated"),
PB.targets in Compile := Seq(
scalapb.gen(flatPackage = true) -> (target in Compile).value / "protobuf-generated"
)
) ++ inConfig(Test)(sbtprotoc.ProtocPlugin.protobufConfigSettings)