Changeset 526


Ignore:
Timestamp:
May 7, 2010, 6:05:50 PM (15 years ago)
Author:
gav
Message:

Refactor UpadateRev script to fix classNotFound exception and make script re-usable.

Location:
trunk/scripts
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/scripts/_Events.groovy

    r522 r526  
    1 includeTargets << grailsScript("UpdateRev")
     1
     2includeTargets << new File("${basedir}/scripts/_UpdateRev.groovy")
    23
    34eventCompileStart = { msg ->
     5    println "Compile started, checking VCS Revision."
    46    updateVcsRevision()
    57}
  • trunk/scripts/_UpdateRev.groovy

    r525 r526  
    1313    def fail = { Map m ->
    1414        result.error = [ code: m.code, args: m.args ]
    15         println "Error: UpdateRev script - " + result.error
     15        println "Error: UpdateRev script: " + result.error
    1616        return result
    1717    }
     
    3434    if(appRevision.revision != svnRevision.revision) {
    3535
    36         println "app.vcsRevision: "+appRevision.revision +', SVN Revision: '+svnRevision.revision
     36        println "app.vcsRevision = "+appRevision.revision +', SVN Revision = '+svnRevision.revision
    3737
    3838        // Update metadata if already loaded.
     
    4949
    5050    } // if(rev != rev)
     51    else {
     52        println "VCS Revisions match: app.vcsRevision = "+appRevision.revision +', SVN Revision = '+svnRevision.revision +'.'
     53    }
    5154
    5255    // Success.
     
    128131
    129132    def revisionString = 'app.vcsRevision=\\$Rev: '+revision+' \\$'
    130     println "Updating application.properties with ${revisionString}"
     133    println "Updating application.properties with: ${revisionString}"
    131134
    132135    def processFileInplace = { file, Closure processText ->
     
    143146
    144147} // writeVcsRevision()
    145 
    146 setDefaultTarget(updateVcsRevision)
Note: See TracChangeset for help on using the changeset viewer.