Skip to content

Instantly share code, notes, and snippets.

@rgueldem
Last active March 23, 2020 19:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgueldem/a77fb3c78926520834124f791a8ad08e to your computer and use it in GitHub Desktop.
Save rgueldem/a77fb3c78926520834124f791a8ad08e to your computer and use it in GitHub Desktop.
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