Based on your comments it sounds like you want a custom Gant script that you can use. You can create your own scripts using the create-script command.
Assuming you use grails create-script MyCustomBuild
A very simple example of what your script may look like:
// MyCustomBuild.groovy
includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsWar")
target(main: "Create a WAR and append to text file") {
// build the WAR file
war()
// Append to the file
// insert your logic here for creating your build number
def buildNumber = new Date().getTime()
def file = new File("somefile.txt")
file.append("Build #: ${buildNumber}\n")
}
setDefaultTarget(main)
Once you create this script you can use it from the grails console or command line as such:
grails mycustombuild