sbt-release
sbt-release copied to clipboard
Aggregate project with different crossScalaVersions
I am trying to release in a single step multiple projects using an aggregate project. Subprojects don't have the same cross build versions.
lazy val root = (project in file(".")).aggregate(projectA, projectB)
lazy val projectA = project.in(file("A"))
.settings(
crossScalaVersions:= Seq(scala211),
...
)
lazy val projectB = project.in(file("B"))
.settings(
crossScalaVersions:= Seq(scala211, scala212),
releaseCrossBuild := true,
...
)
When running sbt release only the 2.11 version of projectB is being built.
Am I trying to do something not supported by sbt-release?
@TBonnin You can use the sbt-doge plugin for this. The plugin is here, and an example build is here. I have no connection to the guys here but I've had the problem before, hope it helps.
@alexflav23 I am currently having the same issue. As sbt-doge is retired because sbt 1 contains the same functionality it would be cool if this plugin could come up with a solution as well.
According to some reports the following doge workaround is applicable to sbt 1.x:
releaseCrossBuild := false
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommandAndRemaining("+test"),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publish"),
setNextVersion,
commitNextVersion,
pushChanges
)
Thanks for the workaround! Worked
I think I had the same issue in sttp, where sub-projects have different cross versions. More concretely, the jvm/js backends target both 2.11 and 2.12, while the native one only 2.11.
To make things work, I had to:
- change the release process to use
+publishSignedetc. (no idea though what's the difference betweenreleaseStepCommandAndRemainingandreleaseStepCommand:) ) - set the default scala version in the root project to 2.11 (otherwise
releasetried to download native-2.12 even though it explicitly stated that it's only using 2.11)
The final release process is here: https://github.com/softwaremill/sttp/blob/master/build.sbt#L20-L31
Thanks all -- just ran in to this with scodec-bits and was able to get it fixed thanks to the comments here.
The doge workaround specified in @eed3si9n wouldn't work if some modules have a custom releasePublishArtifactsAction right?
Unless there is a way to set releasePublishArtifactsAction to a cross command like +assembly?
revisiting this as it is still problem specially now with 2.13 ...
in addition to @eed3si9n workaround in order to be able to skip-tests i'm doing...
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
ReleaseStep { st: State =>
if (!st.get(ReleaseKeys.skipTests).getOrElse(false)) {
releaseStepCommandAndRemaining("+test")(st)
} else {
st
}
},
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)