我有许多并行运行的测试。每个测试都会生成一个扩展报告文件,它是一个html文件。
在测试结束时我看不到如何合并这些文件?
所以我想这样做:
file1.html:
<body>
content-1
</body>
file2.html
<body>
content-2
</body>
结果应该是这样的:
merge.html
<body>
content-1
content-2
</body>
您有个聪明的方法吗?
答案 0 :(得分:1)
<?xml version="1.0" encoding="UTF-8"?>
<project default="concat" name="My Project">
<property name="filesToMerge" value="/home/guest/Desktop/" />
<property name="mergeFile" value="/home/guest/Desktop/merge.html" />
<target name="concat">
<concat destfile="${mergeFile}">
<header filtering="no" trim="no" trimleading="yes">
<body>
</header>
<fileset dir="${filesToMerge}" />
<filterchain>
<linecontains negate="true">
<contains value="<body>" />
</linecontains>
<linecontains negate="true">
<contains value="</body>" />
</linecontains>
</filterchain>
<footer filtering="no" trim="yes" trimleading="yes">
</body>
</footer>
</concat>
</target>
</project>