-
Notifications
You must be signed in to change notification settings - Fork 161
Description
I need to cross compile an SBT multi-project against different Spark and Hadoop versions, and have developed a possible solution that works with sbt-release
. Borrowing the vocab introduced by sbt-cross
plugin, Spark & Hadoop are the two "axes" for cross compilation.
The release process looks like the following:
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
crossProjects(
crossReleaseSteps(
runClean,
runTest,
publishArtifacts
)
),
setNextVersion,
commitNextVersion,
pushChanges
)
The crossProjects
add-on iterates over a list of sub-projects and crossReleaseSteps
iterates over a list of settings to be cross compiled. In this example both are combined but it is possible to use them independently.
There are two additional settings to be set. For example, if there are 3 sub-projects and two axes for cross compilation:
releaseCrossProjects := Seq(subproject1, subproject2, subproject3)
releaseCrossSettings := List(
List(hadoopClassifier -> "hadoop2.7", sparkClassifier -> "spark2.4"),
List(hadoopClassifier -> "hadoop3.1", sparkClassifier -> "spark3.0")
)
I tried integrating sbt-cross
and sbt-release
together but could not make it work. Therefore I developed these add-ons for sbt-release
Would the sbt-release
project be interested in adding the above features to sbt-release
? I would be happy to prepare a PR.