構建信息目錄頁面由 Velocity 模板 buildinfo_list.vm 渲染,引用片段模板 nightlyfrag.vm 及巨集定義 GlobalMacros.vm。
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>每夜構建</title>
<link href="css/default.css" type="text/css" rel="stylesheet">
</head>
<body bgcolor="#ffffff">
<center>
<table border="2" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tr><td class="page-title" bordercolor="#000000" align="left" nowrap>
<font size="+2"><b> 每夜構建 </b> </font></td></tr>
</table>
<p/>
<table border="1" cellspacing="0" cellpadding="3">
#parse( "nightlyfrag.vm" )
</table>
</center>
</body>
</html>
#headerCell("header-center" "序號")
#headerCell("header-left" "管理日誌")
#headerCell("header-left" "構建日誌")
#headerCell("header-left" "度量信息")
#headerCell("header-left" "測試記錄")
#headerCell("header-left" "覆蓋率")
#headerCell("header-left" "產品")
<ul>
#foreach( $key in $BuildList.keySet() )
<tr><td colspan="10" class="title">$key</td></tr>
#set($body=$BuildList.get($key))
#foreach($entry in $body)
#set($tagtime=$BuildList.getTagTime($entry))
<tr>
<td class="row-center">$velocityCount </td>
<td class="row-left"><a href="${BuildList.LogTopDir}/${BuildList.logNamePrefix}${tagtime}.txt">管理日誌</a></td>
<td class="row-left"><a href="${BuildList.projectLogTopDir}/${entry}.txt">構建日誌</a></td>
<td class="row-left"><a href="${BuildList.statCVSTopDir}/${entry}">度量信息</a></td>
<td class="row-left"><a href="${BuildList.testTopDir}/${entry}">測試記錄</a></td>
<td class="row-left"><a href="${BuildList.testCoverTopDir}/${entry}">覆蓋率</a></td>
<td class="row-left"><a href="/${entry}">產品</a></td>
</tr>
#end
#end
</ul>
#macro (headerCell $classStyle $body)
<td class="$classStyle">
<b>$body</b>
</td>
#end
自動化構建體系建置完成,可享受持續集成帶來的效益。維護分析、設計、實作文檔一致性雖具挑戰,但至關重要,需持續迭代改進。優秀的文檔習慣需要團隊與個人共同努力。