Skip to content

Commit

Permalink
Accept snapshot releases for spark 4.0.0 to test against
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsorr committed Sep 6, 2024
1 parent 584bc1e commit 9d1e260
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
enablePlugins(GitVersioning)
Compile / scalafmtOnCompile := true

resolvers +=
"Apache Snapshots" at "https://repository.apache.org/content/groups/snapshots"

organization := "com.github.mrpowers"
name := "spark-fast-tests"

version := "1.10.1"

val versionRegex = """^(.*)\.(.*)\.(.*)$""".r
val versionRegexSnapshot = """^(.*)\.(.*)\.(.*)-20240826\.001610-362$""".r

val sparkVersion = settingKey[String]("Spark version")

Expand All @@ -17,11 +21,17 @@ val scala2_11 = "2.11.17"
sparkVersion := System.getProperty("spark.testVersion", "3.5.1")
crossScalaVersions := {
sparkVersion.value match {
case versionRegexSnapshot("4", _, _) => Seq(scala2_13)
case versionRegex("3", m, _) if m.toInt >= 2 => Seq(scala2_12, scala2_13)
case versionRegex("3", _, _) => Seq(scala2_12)
}
}

scalacOptions ++= Seq(
"-deprecation",
//other options
)

scalaVersion := crossScalaVersions.value.head

libraryDependencies += "org.apache.spark" %% "spark-sql" % sparkVersion.value % "provided"
Expand All @@ -30,7 +40,7 @@ libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.18" %
credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials")

Test / fork := true
javaOptions ++= Seq("-Xms512M", "-Xmx2048M", "-XX:+CMSClassUnloadingEnabled", "-Duser.timezone=GMT")
javaOptions ++= Seq("-Xms512M", "-Xmx2048M", "-Duser.timezone=GMT")

licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT"))
homepage := Some(url("https://github.com/mrpowers-io/spark-fast-tests"))
Expand All @@ -53,7 +63,7 @@ import laika.format.Markdown
import laika.config.SyntaxHighlighting
import laika.ast.Path.Root
import laika.ast.{Image, ExternalTarget}
import laika.helium.config._
import laika.helium.config.*
import laika.helium.Helium

laikaTheme := Helium.defaults.site
Expand Down

0 comments on commit 9d1e260

Please sign in to comment.