forked from scylladb/spark-scylladb-connector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
123 lines (102 loc) · 4.34 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 com.timushev.sbt.updates.UpdatesPlugin.autoImport.dependencyUpdatesFilter
import sbt.Keys.parallelExecution
import sbt.moduleFilter
import sbt._
lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.10"
lazy val supportedScalaVersions = List(scala212, scala211)
// factor out common settings
ThisBuild / scalacOptions += "-target:jvm-1.8"
// Publishing Info
ThisBuild / credentials ++= Publishing.Creds
ThisBuild / homepage := Some(url("https://github.com/datastax/spark-cassandra-connector"))
ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt") )
ThisBuild / organization := "com.datastax.spark"
ThisBuild / organizationName := "Datastax"
ThisBuild / organizationHomepage := Some(url("https://www.datastax.com"))
ThisBuild / pomExtra := Publishing.OurDevelopers
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := Publishing.Repository
ThisBuild / scmInfo := Publishing.OurScmInfo
ThisBuild / version := Publishing.Version
Global / resolvers ++= Seq(
DefaultMavenRepository,
Resolver.sonatypeRepo("public")
)
lazy val IntegrationTest = config("it") extend Test
lazy val integrationTestsWithFixtures = taskKey[Map[TestDefinition, Seq[String]]]("Evaluates names of all " +
"Fixtures sub-traits for each test. Sets of fixture sub-traits names are used to form group tests.")
lazy val assemblySettings = Seq(
assembly / parallelExecution := false,
assembly / test := {},
assembly / assemblyMergeStrategy := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case PathList("META-INF", xs @ _*) => MergeStrategy.last
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
lazy val commonSettings = Seq(
// dependency updates check
dependencyUpdatesFailBuild := true,
dependencyUpdatesFilter -= moduleFilter(organization = "org.scala-lang" | "org.eclipse.jetty"),
fork := true,
parallelExecution := true,
testForkedParallel := false,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
) ++ assemblySettings
val annotationProcessor = Seq(
"-processor", "com.datastax.oss.driver.internal.mapper.processor.MapperProcessor"
)
lazy val root = (project in file("."))
.aggregate(connector, testSupport, driver)
.settings(
// crossScalaVersions must be set to Nil on the aggregating project
crossScalaVersions := Nil,
publish / skip := true
)
lazy val connector = (project in file("connector"))
.configs(IntegrationTest)
.settings(Defaults.itSettings: _*) //This and above enables the "it" suite
.settings(commonSettings)
.settings(
crossScalaVersions := supportedScalaVersions,
// set the name of the project
name := "spark-cassandra-connector",
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
// test grouping
integrationTestsWithFixtures := {
Testing.testsWithFixtures((testLoader in IntegrationTest).value, (definedTests in IntegrationTest).value)
},
IntegrationTest / testGrouping := Testing.makeTestGroups(integrationTestsWithFixtures.value),
IntegrationTest / testOptions += Tests.Argument("-oF"), // show full stack traces
Test / javacOptions ++= annotationProcessor ++ Seq("-d", (classDirectory in Test).value.toString),
Global / concurrentRestrictions := Seq(Tags.limitAll(Testing.parallelTasks)),
libraryDependencies ++= Dependencies.Spark.dependencies
++ Dependencies.TestConnector.dependencies
++ Dependencies.Jetty.dependencies,
scalacOptions in (Compile, doc) ++= Seq("-no-java-comments") //Scala Bug on inner classes, CassandraJavaUtil,
)
.dependsOn(
testSupport % "test",
driver
)
lazy val testSupport = (project in file("test-support"))
.settings(commonSettings)
.settings(
crossScalaVersions := supportedScalaVersions,
name := "spark-cassandra-connector-test-support",
libraryDependencies ++= Dependencies.TestSupport.dependencies
)
lazy val driver = (project in file("driver"))
.settings(commonSettings)
.settings(
crossScalaVersions := supportedScalaVersions,
name := "spark-cassandra-connector-driver",
libraryDependencies ++= Dependencies.Driver.dependencies
++ Dependencies.TestDriver.dependencies
:+ ("org.scala-lang" % "scala-reflect" % scalaVersion.value)
)