-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathbuild.sbt
133 lines (119 loc) · 4.43 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
import Dependencies._
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._
lazy val root = (project in file("."))
.aggregate(server, codec, cqlAntlr, javaClient, itTestCommon, itTestCommonV3, itTestDriver3, itTestDriver20, itTestDriver21)
.settings(
inThisBuild(List(
organization := "org.scassandra",
scalaVersion := "2.12.3",
version := "2.0.0-SNAPSHOT",
crossScalaVersions := Seq("2.12.3", "2.11.11")
)),
name := "scassandra",
publishArtifact := false
)
.disablePlugins(sbtassembly.AssemblyPlugin)
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)
val assemblySettings = Seq(assemblyMergeStrategy in assembly := {
case PathList("javax", "servlet", xs@_*) => MergeStrategy.first
case PathList(ps@_*) if ps.last endsWith ".html" => MergeStrategy.first
case "application.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
test in assembly := {},
assemblyJarName := s"${name.value}-standalone-${version.value}.jar",
artifact in(Compile, assembly) := {
val art = (artifact in(Compile, assembly)).value
art.copy(`classifier` = Some("standalone"))
}
)
val formatPreferences =
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(RewriteArrowSymbols, true)
.setPreference(AlignParameters, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DanglingCloseParenthesis, Preserve)
.setPreference(DoubleIndentConstructorArguments, false)
lazy val server = (project in file("server"))
.settings(
name := "scassandra-server",
scalaVersion := "2.12.3",
libraryDependencies ++= serverDeps,
libraryDependencies ++= serverTestDeps,
(testOptions in Test) += Tests.Argument(TestFrameworks.ScalaTest, "-h", "server/target/report"),
// Crappy, need to fix the e2e tests to use different ports
parallelExecution in Test := false
)
.settings(addArtifact(artifact in(Compile, assembly), assembly).settings: _*)
.settings(formatPreferences)
.settings(assemblySettings)
.dependsOn(codec, cqlAntlr)
.enablePlugins(SbtScalariform)
lazy val javaClient = (project in file("java-client"))
.settings(
name := "java-client",
libraryDependencies ++= clientDeps,
libraryDependencies ++= clientTestDeps,
parallelExecution in Test := false
)
.settings(addArtifact(artifact in(Compile, assembly), assembly).settings: _*)
.settings(assemblySettings)
.dependsOn(cqlAntlr, server)
lazy val codec = (project in file("codec"))
.settings(
name := "scassandra-codec",
libraryDependencies ++= codecDeps,
libraryDependencies ++= codecTestDeps
)
.disablePlugins(sbtassembly.AssemblyPlugin)
lazy val cqlAntlr = (project in file("cql-antlr"))
.settings(
name := "cql-antlr",
libraryDependencies ++= cqlDeps,
libraryDependencies ++= cqlTestDeps,
antlr4Settings,
antlr4PackageName in Antlr4 := Some("org.scassandra.antlr4"),
antlr4Dependency in Antlr4 := antlr
)
.disablePlugins(sbtassembly.AssemblyPlugin)
lazy val itTestCommon = (project in file("java-it-tests/common"))
.settings(
libraryDependencies ++= itTestsCommonDeps,
publishArtifact := false
)
.dependsOn(javaClient)
.disablePlugins(sbtassembly.AssemblyPlugin)
lazy val itTestCommonV3 = (project in file("java-it-tests/common-v3"))
.settings(
libraryDependencies ++= itTestsCommonV3Deps,
publishArtifact := false
)
.dependsOn(javaClient, itTestCommon)
.disablePlugins(sbtassembly.AssemblyPlugin)
lazy val itTestDriver20 = (project in file("java-it-tests/driver20"))
.settings(
libraryDependencies ++= itTestsDriver20Deps,
parallelExecution in Test := false,
publishArtifact := false
)
.dependsOn(javaClient, itTestCommon)
.disablePlugins(sbtassembly.AssemblyPlugin)
lazy val itTestDriver21 = (project in file("java-it-tests/driver21"))
.settings(
libraryDependencies ++= itTestsDriver21Deps,
parallelExecution in Test := false,
publishArtifact := false
)
.dependsOn(javaClient, itTestCommon, itTestCommonV3)
.disablePlugins(sbtassembly.AssemblyPlugin)
lazy val itTestDriver3 = (project in file("java-it-tests/driver30"))
.settings(
libraryDependencies ++= itTestsDriver30Deps,
parallelExecution in Test := false,
publishArtifact := false
)
.dependsOn(javaClient, itTestCommon, itTestCommonV3)
.disablePlugins(sbtassembly.AssemblyPlugin)