Greetings,

At the meeting yesterday, we spoke about various approaches to CVS (Eclipse-based, WinCVS, Ant). Since I tend to use Ant most of the time, I thought I'd send out a little refresher on this approach.

There are basically three Ant commands you need to know:

(1) ant modules

This command tells you which hackystat modules are 'active' from Ant's perspective, by telling you the value of their .available property. If it's 'true', then the module is active in Ant. The following example invocation shows that I currently have about half of the hackystat CVS modules active in Ant. To change the set of active modules, you comment/uncomment these properties in your hackystat.properties file.

c:\cvs\hackyBuild>ant modules
Buildfile: build.xml

modules:
    [echo] hackyAnt:             true
    [echo] hackyCli:             true
    [echo] hackyCocomo:          ${hackyCocomo.available}
    [echo] hackyCourse:          ${hackyCourse.available}
    [echo] hackyEclipse:         ${hackyEclipse.available}
    [echo] hackyEmacs:           ${hackyEmacs.available}
    [echo] hackyJBuilder:        ${hackyJBuilder.available}
    [echo] hackyJupiter:         ${hackyJupiter.available}
    [echo] hackyKernel:          true
    [echo] hackyOffice:          ${hackyOffice.available}
    [echo] hackyPerf:            true
    [echo] hackyPrjSize:         true
    [echo] hackyReport:          true
    [echo] hackyReportExample:   ${hackyReportExample.available}
    [echo] hackyReview:          true
    [echo] hackyStatistics:      true
    [echo] hackyStdExt:          true
    [echo] hackyTDD:             true
    [echo] hackyTelemetry:       true
    [echo] hackyVCS:             true
    [echo] hackyVim:             ${hackyVim.available}
    [echo] hackyVisualStudio:    ${hackyVisualStudio.available}
    [echo] hackySQI:             ${hackySQI.available}
    [echo] hackyQuality:         ${hackyQuality.available}

(2) ant cvsUpdateAll

This command does a 'cvs update' on all of the active modules. You can add the -q to suppress output, but the danger is that you then don't find out about conflicts or merges. (The output is voluminous so I won't include it.)

(3) ant cvsCommitAll

This command does a 'cvs commit' on all of the active modules. It also prompts you to supply a string (enclose it in quotes, please) as the log message for all of the commits. Using -q is not recommended in this case, since it's usually quite interesting to see what's being added to the repository.

A few final comments:

* The nice thing about using Ant is that it's quite easy; since you should normally be editing within your set of 'active' modules (since those are the ones that get built, tested, compiled, etc.), this makes sure you're up to date and makes sure all your changes get into CVS.

* We don't have a facility to import new directories (or even add new files) in Ant. You need to use WinCVS, the cvs command line, Eclipse's cvs mechanism, or something else. I generally use WinCVS when I need to import directories or add files.

Cheers,
Philip






Reply via email to