-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
204 lines (185 loc) · 5.82 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import de.heikoseeberger.sbtheader.HeaderPattern
import Dependencies._
autoScalaLibrary := false
val copyright = headers := Map(
"scala" -> (
HeaderPattern.cStyleBlockComment,
"""|/*
| * Copyright (c) 2016 Tinkoff
| *
| * Licensed under the Apache License, Version 2.0 (the "License");
| * you may not use this file except in compliance with the License.
| * You may obtain a copy of the License at
| *
| * http://www.apache.org/licenses/LICENSE-2.0
| *
| * Unless required by applicable law or agreed to in writing, software
| * distributed under the License is distributed on an "AS IS" BASIS,
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| * See the License for the specific language governing permissions and
| * limitations under the License.
| */
|
| """.stripMargin
)
)
val setts = Seq(
organization := "ru.tinkoff",
version := "1.1.14",
scalaVersion := Versions.scala,
crossScalaVersions := Versions.scalas,
// Doge
releaseCrossBuild := false,
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8"),
copyright,
licenses := Seq(
("Apache License, Version 2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))
),
homepage := Some(url("http://tinkoff.ru")),
sonatypeProfileName := "ru.tinkoff",
pgpReadOnly := false,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
},
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")
},
pomExtra in Global := {
<developers>
<developer>
<id>DanyMariaLee</id>
<name>Marina Sigaeva</name>
<url>http://twitter.com/besseifunction</url>
</developer>
</developers>
},
scmInfo := Some(
ScmInfo(
url("http://github.com/TinkoffCreditSystems"),
"scm:git:github.com/TinkoffCreditSystems/aerospike-scala",
Some("scm:git:[email protected]:TinkoffCreditSystems/aerospike-scala.git")
)
),
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", "", "")
)
lazy val protoSetting = PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
)
lazy val macros =
Project(id = "aerospike-scala-macros", base = file("aerospike-scala-macros"), dependencies = Seq(domain))
.settings(setts)
.settings(libraryDependencies ++= mainLibs(scalaVersion.value))
lazy val domain = Project(id = "aerospike-scala-domain", base = file("aerospike-scala-domain"))
.settings(setts)
.settings(moduleName := "aerospike-scala-domain")
lazy val protoBin =
Project(id = "aerospike-scala-proto", base = file("aerospike-scala-proto"), dependencies = Seq(root))
.settings(setts)
.settings(protoSetting)
.settings(
Seq(
moduleName := "aerospike-scala-proto",
libraryDependencies ++= commonLibs(scalaVersion.value)
)
)
lazy val example =
Project(id = "aerospike-scala-example", base = file("aerospike-scala-example"), dependencies = Seq(root, protoBin))
.settings(setts)
.settings(protoSetting)
.settings(
Seq(
moduleName := "aerospike-scala-example",
libraryDependencies ++= exampleLibs(scalaVersion.value)
)
)
lazy val root =
Project(id = "aerospike-scala", base = file("."), dependencies = Seq(domain, macros))
.settings(setts)
.settings(libraryDependencies ++= commonLibs(scalaVersion.value))
/**
* Helpers
*/
lazy val cleanAll = taskKey[Unit](s"Clean all subprojects")
cleanAll in ThisBuild := clean
.all(ScopeFilter(inAnyProject))
.value
.foreach(identity)
lazy val compileLibraries = taskKey[Unit](s"compile all libraries")
compileLibraries in ThisBuild := Def
.sequential(
compile in (macros, Compile),
compile in (domain, Compile),
compile in (root, Compile),
compile in (protoBin, Compile)
)
.value
lazy val compileAll = taskKey[Unit](s"compile all subprojects")
compileAll in ThisBuild := Def
.sequential(
compileLibraries,
compile in (example, Compile)
)
.value
lazy val recompileAll = taskKey[Unit](s"clean and compile all subprojects")
recompileAll in ThisBuild := Def
.sequential(
cleanAll,
compileLibraries,
compile in (example, Compile)
)
.value
lazy val compileAndTestAll = taskKey[Unit](s"compile all subprojects and test ${root.id}")
compileAndTestAll in ThisBuild := Def
.sequential(
compileAll,
test in (root, Test)
)
.value
lazy val recompileAndTestAll = taskKey[Unit](s"clean, compile all subprojects and test ${root.id}")
recompileAndTestAll in ThisBuild := Def
.sequential(
recompileAll,
test in (root, Test)
)
.value
lazy val publishLibrariesLocal = taskKey[Unit](s"publish all libraries locally")
publishLibrariesLocal in ThisBuild := Def
.sequential(
publishLocal in macros,
publishLocal in domain,
publishLocal in root,
publishLocal in protoBin
)
.value
lazy val publishLibraries = taskKey[Unit](s"publish all libraries")
publishLibraries in ThisBuild := Def
.sequential(
publish in macros,
publish in domain,
publish in root,
publish in protoBin
)
.value
import PgpKeys.publishSigned
lazy val publishSignedLibraries = taskKey[Unit](s"publishSigned all libraries")
publishSignedLibraries in ThisBuild := Def
.sequential(
publishSigned in macros,
publishSigned in domain,
publishSigned in root,
publishSigned in protoBin
)
.value
lazy val publishSignedAll = taskKey[Unit](s"publishSigned all subprojects")
publishSignedAll in ThisBuild := Def
.sequential(
publishSignedLibraries,
publishSigned in example
)
.value