Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compiling library versions #270

Open
pgrandjean opened this issue Feb 8, 2021 · 0 comments
Open

Cross compiling library versions #270

pgrandjean opened this issue Feb 8, 2021 · 0 comments

Comments

@pgrandjean
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant