-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathbuild.sbt
124 lines (108 loc) · 4.02 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
inThisBuild(
List(
organization := "com.github.mrpowers",
homepage := Some(url("https://github.com/mrpowers-io/spark-fast-tests")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
developers ++= List(
Developer("MrPowers", "Matthew Powers", "@MrPowers", url("https://github.com/MrPowers"))
)
)
)
enablePlugins(GitVersioning)
Compile / scalafmtOnCompile := true
name := "spark-fast-tests"
val versionRegex = """^(.*)\.(.*)\.(.*)$""".r
val scala2_13 = "2.13.14"
val scala2_12 = "2.12.20"
val sparkVersion = System.getProperty("spark.version", "3.5.3")
crossScalaVersions := {
sparkVersion match {
case versionRegex("3", m, _) if m.toInt >= 2 => Seq(scala2_12, scala2_13)
case versionRegex("3", _, _) => Seq(scala2_12)
}
}
scalaVersion := crossScalaVersions.value.head
Test / fork := true
lazy val commonSettings = Seq(
javaOptions ++= {
Seq("-Xms512M", "-Xmx2048M", "-Duser.timezone=GMT") ++ (if (System.getProperty("java.version").startsWith("1.8.0"))
Seq("-XX:+CMSClassUnloadingEnabled")
else Seq.empty)
},
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.scalatest" %% "scalatest" % "3.2.18" % "test"
)
)
lazy val core = (project in file("core"))
.settings(
commonSettings,
name := "core",
Compile / packageSrc / publishArtifact := true,
Compile / packageDoc / publishArtifact := true
)
lazy val benchmarks = (project in file("benchmarks"))
.dependsOn(core)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"org.openjdk.jmh" % "jmh-generator-annprocess" % "1.37" // required for jmh IDEA plugin. Make sure this version matches sbt-jmh version!
),
name := "benchmarks",
publish / skip := true
)
.enablePlugins(JmhPlugin)
lazy val docs = (project in file("docs"))
.dependsOn(core)
.enablePlugins(LaikaPlugin)
.settings(
name := "docs",
laikaTheme := {
import laika.ast.Path.Root
import laika.helium.Helium
import laika.helium.config.*
Helium.defaults.site
.landingPage(
title = Some("Spark Fast Tests"),
subtitle = Some("Unit testing your Apache Spark application"),
latestReleases = Seq(
ReleaseInfo("Latest Stable Release", "1.0.0")
),
license = Some("MIT"),
titleLinks = Seq(
VersionMenu.create(unversionedLabel = "Getting Started"),
LinkGroup.create(
IconLink.external("https://github.com/mrpowers-io/spark-fast-tests", HeliumIcon.github)
)
),
linkPanel = Some(
LinkPanel(
"Documentation",
TextLink.internal(Root / "about" / "README.md", "Spark Fast Tests")
)
),
projectLinks = Seq(
LinkGroup.create(
TextLink.internal(Root / "api" / "com" / "github" / "mrpowers" / "spark" / "fast" / "tests" / "index.html", "API (Scaladoc)")
)
),
teasers = Seq(
Teaser("Fast", "Handle small dataframes effectively and provide column assertions"),
Teaser("Flexible", "Works fine with scalatest, uTest, munit")
)
)
.build
},
laikaIncludeAPI := true,
laikaExtensions ++= {
import laika.config.SyntaxHighlighting
import laika.format.Markdown
Seq(Markdown.GitHubFlavor, SyntaxHighlighting)
},
publish / skip := true,
Laika / sourceDirectories := Seq((ThisBuild / baseDirectory).value / "docs")
)
scmInfo := Some(ScmInfo(url("https://github.com/mrpowers-io/spark-fast-tests"), "[email protected]:MrPowers/spark-fast-tests.git"))
updateOptions := updateOptions.value.withLatestSnapshots(false)
import xerial.sbt.Sonatype.sonatypeCentralHost
ThisBuild / sonatypeCredentialHost := sonatypeCentralHost