Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/building-spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,19 @@ On Linux, this can be done by `sudo service docker start`.
or

./build/sbt docker-integration-tests/test

## Change Scala Version

To build Spark using another supported Scala version, please change the major Scala version using (e.g. 2.12):

./dev/change-scala-version.sh 2.12

For Maven, please enable the profile (e.g. 2.12):

./build/mvn -Pscala-2.12 compile

For SBT, specify a complete scala version using (e.g. 2.12.6):

./build/sbt -Dscala.version=2.12.6

Otherwise, the sbt-pom-reader plugin will use the `scala.version` specified in the spark-parent pom.
6 changes: 6 additions & 0 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ object SparkBuild extends PomBuild {
case Some(v) =>
v.split("(\\s+|,)").filterNot(_.isEmpty).map(_.trim.replaceAll("-P", "")).toSeq
}

Option(System.getProperty("scala.version"))
.filter(_.startsWith("2.12"))
.foreach { versionString =>
System.setProperty("scala-2.12", "true")
}
if (System.getProperty("scala-2.12") == "") {
// To activate scala-2.10 profile, replace empty property value to non-empty value
// in the same way as Maven which handles -Dname as -Dname=true before executes build process.
Expand Down
14 changes: 2 additions & 12 deletions repl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<properties>
<sbt.project.name>repl</sbt.project.name>
<extra.source.dir>scala-2.11/src/main/scala</extra.source.dir>
<extra.testsource.dir>scala-2.11/src/test/scala</extra.testsource.dir>
<extra.source.dir>src/main/scala-${scala.binary.version}</extra.source.dir>
<extra.testsource.dir>src/test/scala-${scala.binary.version}</extra.testsource.dir>
</properties>

<dependencies>
Expand Down Expand Up @@ -167,14 +167,4 @@
</plugins>
</build>

<profiles>
<profile>
<id>scala-2.12</id>
<properties>
<extra.source.dir>scala-2.12/src/main/scala</extra.source.dir>
<extra.testsource.dir>scala-2.12/src/test/scala</extra.testsource.dir>
</properties>
</profile>
</profiles>

</project>