Skip to content

Commit

Permalink
Introduce separate variable for next commit message of the next devel…
Browse files Browse the repository at this point in the history
…opment cycle
  • Loading branch information
Marzell Camenzind committed Oct 3, 2019
1 parent 5c4ba08 commit e1abd0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/scala/ReleaseExtra.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,17 @@ object ReleaseStateTransformations {

lazy val commitReleaseVersion = ReleaseStep(commitReleaseVersionAction, initialVcsChecks)
private[sbtrelease] lazy val commitReleaseVersionAction = { st: State =>
val newState = commitVersion(st)
val newState = commitVersion(st, releaseCommitMessage)
reapply(Seq[Setting[_]](
packageOptions += ManifestAttributes(
"Vcs-Release-Hash" -> vcs(st).currentHash
)
), newState)
}

lazy val commitNextVersion = ReleaseStep(commitVersion)
private[sbtrelease] def commitVersion = { st: State =>
lazy val commitNextVersion = {st: State => commitVersion(st, releaseNextCommitMessage)}

private[sbtrelease] def commitVersion = { (st: State, commitMessage: TaskKey[String]) =>
val log = toProcessLogger(st)
val file = st.extract.get(releaseVersionFile).getCanonicalFile
val base = vcs(st).baseDir.getCanonicalFile
Expand All @@ -153,7 +154,7 @@ object ReleaseStateTransformations {
val status = (vcs(st).status !!) trim

val newState = if (status.nonEmpty) {
val (state, msg) = st.extract.runTask(releaseCommitMessage, st)
val (state, msg) = st.extract.runTask(commitMessage, st)
vcs(state).commit(msg, sign, signOff) ! log
state
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/ReleasePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ object ReleasePlugin extends AutoPlugin {
val releaseTagName = taskKey[String]("The name of the tag")
val releaseTagComment = taskKey[String]("The comment to use when tagging")
val releaseCommitMessage = taskKey[String]("The commit message to use when tagging")
val releaseNextCommitMessage = taskKey[String]("The commit message to use for next iteration")
val releaseCrossBuild = settingKey[Boolean]("Whether the release should be cross built")
val releaseVersionFile = settingKey[File]("The file to write the version to")
val releaseUseGlobalVersion = settingKey[Boolean]("Whether to use a global version")
Expand Down Expand Up @@ -234,6 +235,7 @@ object ReleasePlugin extends AutoPlugin {
releaseTagComment := s"Releasing ${runtimeVersion.value}",

releaseCommitMessage := s"Setting version to ${runtimeVersion.value}",
releaseNextCommitMessage := s"Setting version to ${runtimeVersion.value}",

releaseVcs := Vcs.detect(baseDirectory.value),
releaseVcsSign := false,
Expand Down

0 comments on commit e1abd0a

Please sign in to comment.