Skip to content

Commit

Permalink
added Spark version parameter to build (#7)
Browse files Browse the repository at this point in the history
* added Spark version parameter to build

* added version comparison as suggested

* removed unused gradle plugin
  • Loading branch information
eisber authored and jverbus committed Jan 23, 2020
1 parent 3c18641 commit 08f1013
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ spark-warehouse
*.ipr
*.iml
*.iws

isolation-forest/bin
20 changes: 15 additions & 5 deletions isolation-forest/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import org.gradle.util.VersionNumber

plugins {
// Apply the scala plugin to add support for Scala
id 'scala'
}

def sparkVersion = findProperty("sparkVersion") ?: "2.3.0"

println "Spark version: " + sparkVersion

dependencies {
compile("com.chuusai:shapeless_2.11:2.3.2")
compile("com.databricks:spark-avro_2.11:4.0.0")
compile("org.apache.spark:spark-core_2.11:2.3.0")
compile("org.apache.spark:spark-mllib_2.11:2.3.0")
compile("org.apache.spark:spark-sql_2.11:2.3.0")
if(VersionNumber.parse(sparkVersion) >= VersionNumber.parse("2.4.0")) {
compile("org.apache.spark:spark-avro_2.11:2.4.0")
} else {
compile("com.databricks:spark-avro_2.11:4.0.0")
}
compile("org.apache.spark:spark-core_2.11:" + sparkVersion)
compile("org.apache.spark:spark-mllib_2.11:" + sparkVersion)
compile("org.apache.spark:spark-sql_2.11:" + sparkVersion)
compile("org.scalatest:scalatest_2.11:2.2.6")
compile("org.testng:testng:6.8.8")
}
Expand All @@ -17,4 +27,4 @@ test {
useTestNG()
}

archivesBaseName = "${project.name}_2.11"
archivesBaseName = "${project.name}_2.11"

0 comments on commit 08f1013

Please sign in to comment.