Java 使用ant合并多个html文件
我有许多并行运行的测试。每个测试生成一个扩展数据块报告文件,该文件是一个html文件 我看不出如何在测试结束时合并这些文件 所以我想这样做: file1.html:Java 使用ant合并多个html文件,java,ant,extentreports,selenium-extent-report,Java,Ant,Extentreports,Selenium Extent Report,我有许多并行运行的测试。每个测试生成一个扩展数据块报告文件,该文件是一个html文件 我看不出如何在测试结束时合并这些文件 所以我想这样做: file1.html: <body> content-1 </body> 内容-1 file2.html <body> content-2 </body> 内容-2 结果应该是这样的: merge.html <body> content-1
<body>
content-1
</body>
内容-1
file2.html
<body>
content-2
</body>
内容-2
结果应该是这样的:
merge.html
<body>
content-1
content-2
</body>
内容-1
内容-2
你有一个聪明的方法吗?
<?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>
身体
/身体