-
-
Save rgueldem/a77fb3c78926520834124f791a8ad08e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val updateCompatibleVersions = { st: State => | |
val extracted = Project.extract(st) | |
val releaseVersion = extracted.get(version) | |
val vcs = extracted.get(ReleasePlugin.autoImport.releaseVcs).get | |
val vcsBase = vcs.baseDir.getCanonicalFile | |
val sign = extracted.get(ReleasePlugin.autoImport.releaseVcsSign) | |
val file = extracted.get(zen.compatibleVersionsFile) | |
val vcsFile = IO.relativize(vcsBase, file).get | |
val compVersions = s"""zen.compatibleVersions in ThisBuild := Set("$releaseVersion")""" | |
IO.writeLines(file, Seq(compVersions)) | |
vcs.add(vcsFile) ! | |
val status = (vcs.status !!).trim | |
if (status.nonEmpty) { | |
vcs.commit("Updating compatible versions", sign) ! | |
} | |
st | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment