build_run_plugin.xml 3.4 KB
Newer Older
Y
yancen 已提交
1 2 3 4 5 6 7
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="getreport" basedir="../"
         xmlns:jsl="antlib:com.googlecode.jslint4java"> <!-- 配置信息 10.48.31.90:8089-->
    <property name="serverip" value="10.48.31.90:8089"/>
    <property name="report.path" value="_test/tools/br/report_plugins"/>
    <property name="coverage.path" value="_test/coverage"/>
    <property name="report.file" value="_test/tools/br/report.html"/>
L
[test]  
luqiong 已提交
8
    <property name="svn.project" value="ueditor_svn"/>
Y
yancen 已提交
9 10
    <property name="git.project" value="ueditor_git"/>

Y
yancen 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
    <property name="git.user" value=""/>
    <path id="ext.classpath">
        <fileset dir="_test/tools/lib">
            <include name="**/*.jar"/>
        </fileset>
    </path>
    <taskdef uri="antlib:com.googlecode.jslint4java" classpathref="ext.classpath"
             resource="com/googlecode/jslint4java/antlib.xml"/>

    <target name="init">
        <delete dir="${report.path}"/>
        <delete file="${report.file}"/>
    </target>

    <target name="coverage">
        <delete dir="${coverage.path}"/>
        <exec executable="/home/ueditor/jscoverage/bin/jscoverage">
            <arg value="--encoding=UTF-8"/>
            <arg value="_src"/>
            <arg value="${coverage.path}"/>
        </exec>
    </target>

    <!--<target name="jslint" description="Run the JSLint tool on JS files">-->
    <!--<fileset dir="_src" id="jsfiles.raw">-->
    <!--<include name="*.js"/>-->
    <!--&lt;!&ndash;<exclude name="**/*.min.js" />&ndash;&gt;-->
    <!--</fileset>-->
    <!--<pathconvert pathsep=" " property="jsfiles.clean" refid="jsfiles.raw" />-->
    <!--<exec executable="java" output="build/logs/jslint.xml">-->
    <!--<arg line="-jar jslint4java.jar -report xml ${jsfiles.clean}" />-->
    <!--</exec>-->
    <!--</target>-->
    <target name="jslint">
        <!-- jslint 任务的配置如下 ,options 是用户自定义规则-->
        <jsl:jslint options="undef=true, white=true, eqeq=true,nomen=true,sloppy=true" haltOnFailure="false">
            <!--formatter plain, 没有 destfile 则表示输出到控制台 -->
            <formatter type="plain"/>
            <!-- formatter report 表示输出成 html 格式的 report-->
            <formatter type="junit" destfile="_test/tools/br/jslint"/>
            <formatter type="report" destfile="_test/tools/br/jslint.html"/>
            <!-- 通过指定 fileset 设置要进行检测的 JavaScript 文件集 -->
            <fileset dir="_src" includes="**/*.js"/>
        </jsl:jslint>
    </target>
    <!--<target name="jslint">-->
    <!--<formatter type="plain" destfile="_test/tools/br/jslint.out"/>-->
    <!--<fileset dir="_src" id="jsfiles.raw">-->
    <!--<include name="*.js"/>-->
    <!--</fileset>-->
    <!--</target>-->

    <target name="executeplugin" depends="init,coverage">
Y
yancend 已提交
64
        <get src="http://${serverip}/${git.project}/_test/tools/br/runall.php?ci=true&amp;cov=true&amp;filter=plugins,!plugins/table"
Y
yancen 已提交
65
             dest="/tmp/${git.user}_${git.project}plugin.php"/>
Y
yancen 已提交
66 67 68 69 70 71 72 73 74 75 76
    </target>
    <target name="getreportplugin" depends="init,coverage,executeplugin">
        <waitfor maxwait="3000" maxwaitunit="second">
            <available file="${report.file}"/>
        </waitfor>
        <waitfor maxwait="10" maxwaitunit="second">
            <istrue value="false"/>
        </waitfor>
    </target>

</project>