Skip to content

Commit

Permalink
Scala 2.12 compatibility.
Browse files Browse the repository at this point in the history
Apache Spark has embraced the GA support for 2.12 since the version 2.4.1, that was released nearly a year ago.
The Amazon EMR v6.0.0 characterised by the adoption of Hadoop 3.2.1 (sic!) and Scala 2.12 (although the default JDK is still Coretto 8) has been released a month ago, hence I presume it would be nice to have cross-builds for the Lighthouse.

This PR was cherry-picked from datamindedbe#27, where you can observe the matrix builds, as currently the Circle CI config supports only 2.11.

Changelog:
- enable cross-version builds for the projects;
- fix compile-time warning.
  • Loading branch information
mrgambal committed Apr 8, 2020
1 parent 4b3fd57 commit ca42be1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sbt.Opts.resolver.sonatypeStaging
lazy val buildSettings = Seq(
organization := "be.dataminded",
scalaVersion := scala211,
crossScalaVersions := Nil,
crossScalaVersions := supportedScalaVersions,
// Ensure code quality
scalafmtOnCompile := true,
// Memory settings to be able to test with Spark
Expand All @@ -15,14 +15,14 @@ lazy val buildSettings = Seq(
javaOptions ++= Seq(
"-Xms768M",
"-Xmx2048M",
"-XX:+CMSClassUnloadingEnabled",
"-XX:+UseStringDeduplication",
"-XX:+UseG1GC",
"-Dspark.sql.shuffle.partitions=2",
"-Dspark.shuffle.sort.bypassMergeThreshold=2",
"-Dlighthouse.environment=test"
),
scalacOptions ++= Seq(
"-deprecation",
"-optimize",
"-unchecked",
"-Ydelambdafy:inline",
"-Ypartial-unification",
Expand Down Expand Up @@ -61,8 +61,7 @@ lazy val lighthouse = (project in file("lighthouse-core"))
lazy val `lighthouse-testing` = (project in file("lighthouse-testing"))
.settings(
buildSettings,
libraryDependencies ++= Seq(sparkSql, sparkHive, scalaTest, betterFiles),
crossScalaVersions := supportedScalaVersions
libraryDependencies ++= Seq(sparkSql, sparkHive, scalaTest, betterFiles)
)

lazy val `lighthouse-demo` = (project in file("lighthouse-demo"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LighthouseConfigurationParser extends OptionParser[LighthouseConfiguration

opt[String]('e', "environment")
.action((environment, config) => config.copy(environment = environment))
.withFallback(fallbackEnvironment)
.withFallback(() => fallbackEnvironment())
.validate(item => if (item.nonEmpty) success else failure("The configured environment for Lighthouse is empty"))
.required()

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.7
sbt.version=1.3.8

0 comments on commit ca42be1

Please sign in to comment.