Passing variables back to TeamCity from a Gradle build script

We store our version information for our products in source control. I would like to pass the version numbers back to TeamCity so that it can use it to tag successful builds. Is there  a way to pass stuff back or set TeamCity variables from within Gradle? Otherwise we're going to have to hand-set the version on each of the release builds.

Please sign in to leave a comment.