Skip to content

Instantly share code, notes, and snippets.

@nblair
Created July 13, 2016 16:53
Show Gist options
  • Save nblair/d87a44f0300d4aca3b058f2d0cb7bd19 to your computer and use it in GitHub Desktop.
Save nblair/d87a44f0300d4aca3b058f2d0cb7bd19 to your computer and use it in GitHub Desktop.
Gradle task to assist in release management, to be paired with: https://gist.github.com/nblair/53f44e08104354dd078e6104d7dae4a8
/**
* Task executed by Jenkins on merges to master to confirm that we appropriately track the last
* released version.
* Typical commands executed by this Jenkins job, in order:
* 1. gradlew clean updateProjectLast
* 2. git commit -am "Tracking last released version"
* 3. gradlew bootRepackage uploadArchives
*/
task updateProjectLast() {
doLast {
Properties properties = new Properties();
properties.load(new FileInputStream("project.last"))
properties.setProperty("last.released.version", getVersion())
properties.store(new FileOutputStream("project.last"), "this file is automatically managed, do not edit")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment