Demo entry 6343506

1

   

Submitted by 1 on Jan 10, 2017 at 01:41
Language: XML. Code size: 19.3 kB.

<?xml version="1.0" ?>
<project name="convergeAll" xmlns:jacoco="antlib:org.jacoco.ant" default="jacoco">

    <!--Jacoco的安装路径-->
    <property name="jacocoantPath" value="/usr/jacoco/lib/jacocoant.jar"/>
    <!--生成的3个-->
    <property name="wftestExecPath" value="/home/work/local/hundsun/report/wftest.exec"/>
    <property name="serverautotestExecPath" value="/home/work/local/hundsun/report/serverautotest.exec"/>
    <property name="autotestnullExecPath" value="/home/work/local/hundsun/report/autotestnull.exec"/>
    <!--合并报告的路径-->
    <property name="mergeExexPath" value="/home/work/local/hundsun/report/merged.exec"/>
    <!--需要进行合并的3个报告存放的路径-->
    <property name="mergePath" value="/home/work/local/hundsun/report/" />

    <!--生成合并覆盖率html报告的路径,直接放在tomct下面,外界直接访问-->
    <property name="mergeReportfolderPath" value="/root/Tomcat_test/webapps/report"/>
    <property name="wftestReportfolderPath" value="/root/Tomcat1/webapps/report"/> 
    <property name="serverautotestReportfolderPath" value="/root/Tomcat2/webapps/report"/>
    <property name="autotestnullReportfolderPath" value="/root/Tomcat3/webapps/report"/>

    <!--远程tomcat服务的ip地址,因为和ant装在一个机器上,所以就是本地-->
    <property name="server_ip" value="127.0.0.1"/>
    <!--jacoco在3个Tomcat开放出来的端口-->
    <property name="wftest_server_port" value="8291"/>
    <property name="serverautotest_server_port" value="8292"/>
    <property name="autotestnull_server_port" value="8293"/>

    <!--源代码路径-->
    <property name="api_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.api-1.2.5-sources/" />
    <property name="common_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.common-1.2.5-sources/" />
    <property name="core_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.core-1.2.5-sources/" />
    <property name="formapi_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.form.api-1.2.5-sources/" />
    <property name="formimpl_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.form.impl-1.2.5-sources/" />
    <property name="velocity_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.integration.remoting.velocity-1.2.5-sources/" />
    <property name="remotingapi_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.remoting.api-1.2.5-sources/" />
    <property name="remotingimpl_src" value="/root/source_code/1.2.5/com.hundsun.jres.workflow.remoting.impl-1.2.5-sources/" />

    <!--.class文件路径-->
    <property name="api_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.api-1.2.5/com/hundsun/" />
    <property name="common_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.common-1.2.5/com/hundsun/" />
    <property name="core_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.core-1.2.5/com/hundsun/" />
    <property name="formapi_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.form.api-1.2.5/com/hundsun/" />
    <property name="formimpl_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.form.impl-1.2.5/com/hundsun/" />
    <property name="velocity_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.integration.remoting.velocity-1.2.5-jar/com/hundsun/" />
    <property name="remotingapi_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.remoting.api-1.2.5/com/hundsun/" />
    <property name="remotingimpl_class" value="/root/wftest/20170104/wf_server/WEB-INF/lib/com.hundsun.jres.workflow.remoting.impl-1.2.5/com/hundsun/" />

    <!--让ant知道去哪儿找Jacoco-->
    <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
        <classpath path="${jacocoantPath}" />
    </taskdef>

    <target name="createReport">
            <!--首先把三个tomcat中的数据给导出来-->
            <jacoco:dump address="${server_ip}" reset="false" destfile="${wftestExecPath}" port="${wftest_server_port}" append="true"/>
            <jacoco:dump address="${server_ip}" reset="false" destfile="${serverautotestExecPath}" port="${serverautotest_server_port}" append="true"/>
            <jacoco:dump address="${server_ip}" reset="false" destfile="${autotestnullExecPath}" port="${autotestnull_server_port}" append="true"/>

            <!--合并这三个生成的数据-->
            <jacoco:merge destfile="${mergeExexPath}">
                <fileset dir="${mergePath}" includes="*.exec"/>
            </jacoco:merge>

            <!--根据文件夹下的4个exec数据文件,生成对应的report文件夹并部署到对应的tomcat下-->
            <delete dir="${mergeReportfolderPath}" />
            <mkdir dir="${mergeReportfolderPath}" />

            <delete dir="${wftestReportfolderPath}" />
            <mkdir dir="${wftestReportfolderPath}" />
            
            <delete dir="${serverautotestReportfolderPath}" />
            <mkdir dir="${serverautotestReportfolderPath}" />
            
            <delete dir="${autotestnullReportfolderPath}" />
            <mkdir dir="${autotestnullReportfolderPath}" />
        
            
            <jacoco:report>
                <executiondata>
                    <file file="${wftestExecPath}" />
                </executiondata>
                <structure name="Wftest Report">
                    <group name="API related">           
                        <classfiles>
                            <fileset dir="${api_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${api_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Common related">           
                        <classfiles>
                            <fileset dir="${common_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${common_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Core related">           
                        <classfiles>
                            <fileset dir="${core_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${core_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form API related">           
                        <classfiles>
                            <fileset dir="${formapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form Impl related">           
                        <classfiles>
                            <fileset dir="${formimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formimpl_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Velocity related">           
                        <classfiles>
                            <fileset dir="${velocity_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${velocity_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting API related">           
                        <classfiles>
                            <fileset dir="${remotingapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting Impl related">           
                        <classfiles>
                            <fileset dir="${remotingimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingimpl_src}" />
                        </sourcefiles>
                    </group>
                </structure>
                <html destdir="${wftestReportfolderPath}" encoding="utf-8" />         
            </jacoco:report>

            <jacoco:report>
                <executiondata>
                    <file file="${serverautotestExecPath}" />
                </executiondata>
                <structure name="Serverautotest Report">
                    <group name="API related">           
                        <classfiles>
                            <fileset dir="${api_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${api_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Common related">           
                        <classfiles>
                            <fileset dir="${common_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${common_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Core related">           
                        <classfiles>
                            <fileset dir="${core_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${core_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form API related">           
                        <classfiles>
                            <fileset dir="${formapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form Impl related">           
                        <classfiles>
                            <fileset dir="${formimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formimpl_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Velocity related">           
                        <classfiles>
                            <fileset dir="${velocity_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${velocity_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting API related">           
                        <classfiles>
                            <fileset dir="${remotingapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting Impl related">           
                        <classfiles>
                            <fileset dir="${remotingimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingimpl_src}" />
                        </sourcefiles>
                    </group>
                </structure>
                <html destdir="${serverautotestReportfolderPath}" encoding="utf-8" />         
            </jacoco:report>

            <jacoco:report>
                <executiondata>
                    <file file="${autotestnullExecPath}" />
                </executiondata>
                <structure name="Autotestnull Report">
                    <group name="API related">           
                        <classfiles>
                            <fileset dir="${api_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${api_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Common related">           
                        <classfiles>
                            <fileset dir="${common_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${common_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Core related">           
                        <classfiles>
                            <fileset dir="${core_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${core_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form API related">           
                        <classfiles>
                            <fileset dir="${formapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form Impl related">           
                        <classfiles>
                            <fileset dir="${formimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formimpl_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Velocity related">           
                        <classfiles>
                            <fileset dir="${velocity_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${velocity_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting API related">           
                        <classfiles>
                            <fileset dir="${remotingapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting Impl related">           
                        <classfiles>
                            <fileset dir="${remotingimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingimpl_src}" />
                        </sourcefiles>
                    </group>
                </structure>
                <html destdir="${autotestnullReportfolderPath}" encoding="utf-8" />         
            </jacoco:report>


            <jacoco:report>
                <executiondata>
                    <file file="${mergeExexPath}" />
                </executiondata>
                <structure name="Merge Report">
                    <group name="API related">           
                        <classfiles>
                            <fileset dir="${api_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${api_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Common related">           
                        <classfiles>
                            <fileset dir="${common_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${common_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Core related">           
                        <classfiles>
                            <fileset dir="${core_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${core_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form API related">           
                        <classfiles>
                            <fileset dir="${formapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Form Impl related">           
                        <classfiles>
                            <fileset dir="${formimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${formimpl_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Velocity related">           
                        <classfiles>
                            <fileset dir="${velocity_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${velocity_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting API related">           
                        <classfiles>
                            <fileset dir="${remotingapi_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingapi_src}" />
                        </sourcefiles>
                    </group>
                    <group name="Remoting Impl related">           
                        <classfiles>
                            <fileset dir="${remotingimpl_class}" />
                        </classfiles>
                        <sourcefiles encoding="utf-8">
                            <fileset dir="${remotingimpl_src}" />
                        </sourcefiles>
                    </group>
                </structure>
                <html destdir="${mergeReportfolderPath}" encoding="utf-8" />         
            </jacoco:report>

    </target>
</project>


<html destdir="${reportfolderPath}" encoding="utf-8" />
<csv destfile="/root/report.csv" />
<xml destfile="/root/report.xml" />

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).