I was talking last week about using XML to act as an intermediate step in building your documentation (Automating Documentation and Automating Documentation Part 2). It dawned on me that I could also share my technique for building release notes.
I use Subversion. I’ve gotten positively anal about commenting when I make changes. So if you were to take the history of my SVN commits, they make pretty decent release notes. The trick is to grab them and automatically turn them into documentation.
SVN makes this pretty easy. It takes one command to grab all of the changes. It takes one switch to make the change export as XML. Once that is done, manipulating the content in ColdFusion is a breeze. I do it using <cfexecute> and svn.exe, below is my code:
<cfset svn.wc = “[path to svn working copy]”
<cfset svn.exe = “[path to svn executable]”
<!— -v = verbose –xml outputs it as xml —>
<cfset svn.arg = “log #svn.wc# -v –xml”
<!— get contents of SVN history —>
<cfset changes = XMLParse(changes) />
<!— lxml = LoopLocalXML (shorted for display) —>
<cfset lXML = changes.log.logEntry[i] />
<!— lPaths = LoopLocalpaths —>
<cfset lPaths = lXML.paths.path[j] />
In my build process, I use <cfsavecontent> and <cffile> to write the content to a file, and then use ANT to call the CFML page that creates the release notes – voila, release notes are now part of every build, with no extra work on my part.