» 网友学堂 » JAVA教程 » 实战每晚构建08
实战每晚构建08
作者:ljjk5 发表时间:2007-12-30 11:41 阅读:61次 在百度搜索相关内容

3.5 显示界面模版
显示界面模版在velocity模版文件buildinfo_list.vm中实现。这个文件引用了nightlyfrag.vm文件,另外定义宏headerCell的文在为GlobalMacros.vm。
模版文件buildinfo_list.vm:
<html>
<head>
<meta http-equiv="content-type" c>
<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>
</html>
模版文件nightlyfrag.vm:
#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>
宏定义文件GlobalMacros.vm:
#macro (headerCell $classStyle $body)
<td class="$classStyle">
<b>
$body
</b>
</td>
#end
4、结语
到此所有工作结束,我们可以享受自动构建带来的效益和好处。值得提及的是保持分析、设计和实现文档的一致性非常困难而且非常重要,工作要不断地进行反复。编写良好的文档,保持优秀的写作习惯需要单位和个人共同的努力。
5、文档书写辅助工具
word 文档书写排版工具
powerpoint,图片组织绘画工具
visio 绘制数据流图,ER图等的工具
rational rose,绘制UML图形的工具
windows 附件中的画图来截取图片
操作系统的全屏打印功能

#Advertisement