Skip to content

Commit

Permalink
Merge pull request #4 from bp/dazfuller/spark-3.0.2-update
Browse files Browse the repository at this point in the history
add config for Spark 3.0.2
  • Loading branch information
azurecoder authored Mar 3, 2021
2 parents 6e0a4ba + 7da3761 commit ce51f9a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
17 changes: 17 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$versions = @("3.0.1", "3.0.2", "3.1.1")
$jarPath = "./target/jars"

Write-Host "Clearing existing jar artefacts" -ForegroundColor Green
if (Test-Path $jarPath) {
Remove-Item -Path $jarPath -Force -Recurse
}

New-Item -Path $jarPath -ItemType Directory

foreach ($version in $versions) {
Write-Host "Building for Spark version: $version" -ForegroundColor Green
& sbt -DsparkVersion="$version" clean compile test package
}

Write-Host "Copying jar files to $jarPath" -ForegroundColor Green
Get-ChildItem -Filter "spark-cef*.jar" -Path ./target -Recurse | Copy-Item -Destination $jarPath
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ val sparkVersion = settingKey[String]("Spark version")
val scalaTestVersion = settingKey[String]("ScalaTest version")

name := "spark-cef-reader"
version := "0.1-SNAPSHOT"
version := "0.2-SNAPSHOT"
organization := "com.bp"
description := "CEF data source for Spark"
homepage := Some(url("https://github.com/bp"))
Expand All @@ -14,6 +14,8 @@ developers ++= List(
Developer(id = "azurecoder", name = "Richard Conway", email = "richard@elastacloud.com", url = url("https://github.com/elastacloud"))
)

target := file("target") / s"spark-${sparkVersion.value}"

artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
s"${artifact.name}-${sv.binary}_${sparkVersion.value}-${module.revision}.${artifact.extension}"
}
Expand All @@ -34,7 +36,7 @@ libraryDependencies ++= Seq(

// Define common settings for the library
val commonSettings = Seq(
sparkVersion := System.getProperty("sparkVersion", "3.0.1"),
sparkVersion := System.getProperty("sparkVersion", "3.1.1"),
scalaVersion := {
if (sparkVersion.value < "3.0.0") {
"2.11.12"
Expand Down

0 comments on commit ce51f9a

Please sign in to comment.