Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #125 from alexarchambault/topic/scala-2.12
Browse files Browse the repository at this point in the history
Enable 2.12 build
  • Loading branch information
alexarchambault committed Jan 4, 2017
2 parents bd34674 + 950e225 commit fe7cf02
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,6 +1,7 @@
language: scala
scala:
- 2.11.8
- 2.12.1
jdk:
- oraclejdk8
script: project/run-travis ${TRAVIS_SCALA_VERSION} ${TRAVIS_PULL_REQUEST} ${TRAVIS_BRANCH}
Expand Down
41 changes: 40 additions & 1 deletion build.sbt
Expand Up @@ -50,7 +50,7 @@ lazy val `scala-cli` = project.in(file("cli"))
.settings(
crossVersion := CrossVersion.full,
libraryDependencies ++= Seq(
"com.github.alexarchambault" %% "case-app" % "1.1.2",
"com.github.alexarchambault" %% "case-app" % "1.1.3",
"ch.qos.logback" % "logback-classic" % "1.1.7"
),
libraryDependencies ++= {
Expand All @@ -69,6 +69,7 @@ lazy val `spark-stubs-1` = project
"org.apache.spark" %% "spark-sql" % "1.3.1" % "provided"
)
)
.settings(disableScalaVersion("2.12"))

lazy val `spark-stubs-2` = project
.in(file("spark/stubs-2.x"))
Expand All @@ -78,6 +79,7 @@ lazy val `spark-stubs-2` = project
"org.apache.spark" %% "spark-sql" % "2.0.0" % "provided"
)
)
.settings(disableScalaVersion("2.12"))

lazy val spark = project
.in(file("spark/core"))
Expand All @@ -90,6 +92,7 @@ lazy val spark = project
"io.get-coursier" %% "coursier-cli" % "1.0.0-M14-9"
)
)
.settings(disableScalaVersion("2.12"))
.settings(jupyterScalaBuildInfoSettingsIn("jupyter.spark.internals"))

val ammoniteTestsDependency = "org.jupyter-scala" % "ammonite" % ammoniumVersion cross CrossVersion.full
Expand Down Expand Up @@ -120,6 +123,7 @@ lazy val flink = project
"org.ow2.asm" % "asm-all" % "5.0.4" // don't know why we have to manually pull this one
)
)
.settings(disableScalaVersion("2.12"))

lazy val `flink-yarn` = project
.dependsOn(flink, `scala-api` % "provided")
Expand All @@ -130,6 +134,7 @@ lazy val `flink-yarn` = project
"org.apache.flink" %% "flink-yarn" % flinkVersion
)
)
.settings(disableScalaVersion("2.12"))

lazy val scio = project
.dependsOn(`scala-api` % "provided")
Expand All @@ -148,6 +153,7 @@ lazy val scio = project
)
}
)
.settings(disableScalaVersion("2.12"))


lazy val `jupyter-scala` = project
Expand Down Expand Up @@ -231,6 +237,39 @@ lazy val noPublishSettings = Seq(
publishArtifact := false
)

def disableScalaVersion(sbv: String*) = Seq(
baseDirectory := {
if (sbv.contains(scalaBinaryVersion.value))
baseDirectory.value / "dummy"
else
baseDirectory.value
},
libraryDependencies := {
if (sbv.contains(scalaBinaryVersion.value))
Nil
else
libraryDependencies.value
},
publish := {
if (sbv.contains(scalaBinaryVersion.value))
()
else
publish.value
},
publishLocal := {
if (sbv.contains(scalaBinaryVersion.value))
()
else
publishLocal.value
},
publishArtifact := {
if (sbv.contains(scalaBinaryVersion.value))
false
else
publishArtifact.value
}
)

def jupyterScalaBuildInfoSettingsIn(packageName: String) = buildInfoSettings ++ Seq(
sourceGenerators in Compile += buildInfo.taskValue,
buildInfoKeys := Seq[BuildInfoKey](
Expand Down
10 changes: 7 additions & 3 deletions project/run-tests
Expand Up @@ -4,10 +4,14 @@ set -ev
# On Travis, this leaves more memory to the forked JVM where tests are run
export SBT_OPTS="-J-Xmx512m -J-Xms512m"

SCALA_VERSION=${TRAVIS_SCALA_VERSION:-2.11.8}

function testOnly() {
sbt ++${TRAVIS_SCALA_VERSION:-2.11.8} "testOnly $@"
sbt ++$SCALA_VERSION "testOnly $@"
}

testOnly jupyter.Spark16Tests
testOnly jupyter.Spark20Tests
if grep -q '$2\.12\.' <(echo "$SCALA_VERSION"); then
testOnly jupyter.Spark16Tests
testOnly jupyter.Spark20Tests
fi

0 comments on commit fe7cf02

Please sign in to comment.