Home »
Uncategories »
Version Automation in Grails Application
Version Automation in Grails Application
To increment version of grails app in every build or compile
- Add _Events.groovy file in PROJECT_HOME/scripts folder
- Edit file and add following code
eventCompileStart = { kind ->
def buildNumber = metadata.'app.buildNumber'
if (!buildNumber)
buildNumber = 1
else
buildNumber = Integer.valueOf(buildNumber) + 1
metadata.'app.buildNumber' = buildNumber.toString()
metadata.persist()
println "**** Compile Starting on Build #${buildNumber}"